1
0
mirror of https://github.com/golang/go synced 2024-10-04 10:11:21 -06:00
Commit Graph

22 Commits

Author SHA1 Message Date
Jan Ziak
397f129daf cmd/gc: avoid confusing error message "ovf in mpaddxx"
Fixes #6889

LGTM=rsc
R=gri, rsc
CC=golang-codereviews
https://golang.org/cl/85080044
2014-04-09 08:36:27 +02:00
Russ Cox
7d734d9252 build: remove various uses of C undefined behavior
If you thought gcc -ansi -pedantic was pedantic, just wait
until you meet clang -fsanitize=undefined.

I think this addresses all the reported "errors", but we'll
need another run to be sure.

all.bash still passes.

Update #5764

Dave, can you please try again?

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13334049
2013-09-09 15:07:23 -04:00
Rémy Oudompheng
79db6ada48 cmd/gc: error on constant shift overflows.
Fixes #3019.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5674044
2012-02-16 00:19:42 +01:00
Russ Cox
337547d1c9 gc: make constant arith errors a little more friendly
Fixes #2804.

R=ken2
CC=golang-dev
https://golang.org/cl/5652067
2012-02-11 00:50:56 -05:00
Lucio De Re
b3cc4897be gc: fix build on Plan 9
gc/bits.c
. improved format with associated cast;
gc/closure.c
gc/dcl.c
gc/range.c
gc/reflect.c
gc/sinit.c
. dropped unnecessary assignments;
gc/gen.c
. dropped unnecessary assignment;
. added static qualifier to local function definition;
gc/go.h
. added varargck pragmas;
gc/lex.c
. used {} instead of ; in if statement to suppress warning;
. replaced exit(0) with exits(0);
. added compilation conditions for SIGBUS/SIGSEGV;
. dropped unnecessary assignment;
gc/mparith2.c
. dropped four unnecessary assignments/initialisations;
gc/obj.c
. added type cast to local pointer;
gc/pgen.c
. added cast and related print format;
gc/subr.c
. replaced exit(1) with exits("error");
. replaced unlink() with remove();
. renamed local cistrmp() as ucistrmp() to remove conflict with
  Plan 9 function by the same name;
gc/swt.c
. added braces instead of ; as empty statment;
gc/typecheck.c
. added static qualifier to local function definition;
. dropped unnecessary assignments;
gc/walk.c
. dropped unnecessary assignments;
. added static qualifier to local function definitions;

R=rsc
CC=golang-dev
https://golang.org/cl/4964046
2011-08-29 09:35:04 -04:00
Russ Cox
61f84a2cdc gc: shuffle #includes
#include "go.h" (or "gg.h")

becomes

#include <u.h>
#include <libc.h>
#include "go.h"

so that go.y can #include <stdio.h>
after <u.h> but before "go.h".
This is necessary on Plan 9.

R=ken2
CC=golang-dev
https://golang.org/cl/4971041
2011-08-25 16:25:10 -04:00
Russ Cox
9bac9d23d3 gc: index bounds tests and fixes
move constant index checking to front end
x[2:1] is a compile-time error now too

R=ken2
CC=golang-dev
https://golang.org/cl/1848056
2010-08-03 00:26:02 -07:00
Ken Thompson
95b93c28e3 1. got 29 (Mpscale) more bits of precision
out of floating constant multiply
2. added rounding code to "const fix=float"
to allow up to 29 (Mpscale) bits of
slop and still get an exact fixed constant.

fixes #931

R=rsc
CC=golang-dev
https://golang.org/cl/1692055
2010-07-17 16:32:40 -07:00
Russ Cox
d5a80d0ba4 gc: no more ...
various cleanup, deleting unused code

R=ken2
CC=golang-dev
https://golang.org/cl/1663041
2010-06-14 11:24:51 -07:00
Ken Thompson
ce85868a00 bug in const float divide
R=rsc
CC=golang-dev
https://golang.org/cl/204042
2010-02-05 15:18:32 -08:00
Ken Thompson
c4de24981a signs on div and mod
R=r
OCL=28319
CL=28319
2009-05-05 21:19:58 -07:00
Russ Cox
5fbadf0bc3 warn -> yyerror in mparith.
close two more bugs.

R=ken
OCL=26226
CL=26226
2009-03-12 19:57:30 -07:00
Russ Cox
8f194bf5ff make 6g constants behave as ken proposes. (i hope.)
various bug fixes and tests involving constants.

test/const1.go is the major new test case.

R=ken
OCL=26216
CL=26224
2009-03-12 19:04:38 -07:00
Ken Thompson
bb02e481d2 added bitclear operators &^ and &^=
R=r
OCL=26152
CL=26152
2009-03-11 19:59:35 -07:00
Ken Thompson
3fa4610601 multi precision floating point
R=r
OCL=20185
CL=20185
2008-12-01 17:22:05 -08:00
Russ Cox
a1585b676b fix the easy parts of bug120
R=r,ken
DELTA=66  (52 added, 3 deleted, 11 changed)
OCL=19386
CL=19389
2008-11-17 13:58:45 -08:00
Ken Thompson
2c050571d8 shift bugs
R=r
OCL=18095
CL=18095
2008-10-29 20:25:34 -07:00
Ken Thompson
4fdf3d6247 bug 113
R=r
OCL=18077
CL=18077
2008-10-29 16:38:23 -07:00
Russ Cox
c8b9970e16 change *a1++; to plain a1++
R=ken
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=16489
CL=16489
2008-10-04 02:54:19 -07:00
Russ Cox
45f4e38506 silence gcc warnings
R=ken
OCL=16449
CL=16466
2008-10-03 16:23:02 -07:00
Ken Thompson
53010efe01 shift operations to new spec
R=r
OCL=14641
CL=14641
2008-08-28 19:59:42 -07:00
Ken Thompson
091047f36c adding and deleting files
R=r
DELTA=1685  (920 added, 765 deleted, 0 changed)
OCL=14030
CL=14030
2008-08-09 17:33:35 -07:00