1
0
mirror of https://github.com/golang/go synced 2024-09-24 21:20:13 -06:00
Commit Graph

329 Commits

Author SHA1 Message Date
Russ Cox
2281ca169c gc: fix &^=
Fixes #1394.

R=ken2
CC=golang-dev
https://golang.org/cl/3879041
2011-01-06 11:21:18 -05:00
Anthony Martin
94df1a067c gc: return constant floats for parts of complex constants
Fixes #1369.

R=rsc
CC=golang-dev
https://golang.org/cl/3731046
2011-01-05 13:12:30 -05:00
Patrick Gavlin
4e5a59591b gc: rewrite complex /= to l = l / r.
Fixes #1368.

R=rsc, ejsherry
CC=golang-dev
https://golang.org/cl/3811042
2011-01-04 13:14:17 -05:00
Russ Cox
0c54225b51 remove nacl
The recent linker changes broke NaCl support
a month ago, and there are no known users of it.

The NaCl code can always be recovered from the
repository history.

R=adg, r
CC=golang-dev
https://golang.org/cl/3671042
2010-12-15 11:49:23 -05:00
Russ Cox
dc9a3b2791 gc: align structs according to max alignment of fields
cc: same
runtime: test cc alignment (required moving #define of offsetof to runtime.h)
fix bug260

Fixes #482.
Fixes #609.

R=ken2, r
CC=golang-dev
https://golang.org/cl/3563042
2010-12-13 16:22:19 -05:00
Eoghan Sherry
cab83650d1 gc: skip undefined symbols in import .
Fixes #1284.

R=ken3, rsc
CC=golang-dev
https://golang.org/cl/3210041
2010-12-07 16:16:01 -05:00
Eoghan Sherry
6aa85d1cbe gc: fix method offsets of anonymous interfaces
Fixes #1290.

R=rsc
CC=golang-dev
https://golang.org/cl/3259043
2010-12-07 12:56:26 -05:00
Robert Griesemer
5a9ad8b9e3 go/ast: use token.Pos instead of token.Position; adjust all dependent code
Specifically:

	* lib/godoc:
	- provide file set (FSet) argument to formatters where needed

	* src/cmd:
	- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
	- godoc: remove local binary search with sort.Search (change by rsc),
	  extract file set for formatters

	* src/pkg:
	- exp/eval: remove embedded token.Position fields from nodes and replace
	  with named token.Pos fields; add corresponding Pos() accessor methods
	- go/token: added file.Line(), changed signature of File.Position()

	* test/fixedbugs/:
	- bug206.go: change test to not rely on token.Pos details

	* added various extra comments
	* Runs all.bash
	* gofmt formats all of src, misc w/o changes
	* godoc runs

	* performance:
	- The new version of godoc consumes about the same space after indexing
	  has completed, but indexing is half the speed. Significant space savings
	  are expected from smaller ASTs, but since they are thrown away after a
	  file has been indexed, this is not visible anymore. The slower indexing
	  time is due to the much more expensive computation of line information.
	  However, with the new compressed position information, indexing can be
	  rewritten and simplified. Furthermore, computing the line info can be
	  done more efficiently.

        New godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	44381 godoc        0.0%  0:38.00   4    19    149  145M   184K   148M   176M

	2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
	2010/12/03 17:58:35 bytes=90858456 footprint=199182584
	2010/12/03 17:58:36 bytes=47858568 footprint=167295224

	Old godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	23167 godoc        0.0%  0:22.02   4    17    132  129M   184K   132M   173M

	2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
	2010/12/03 14:51:32 bytes=66404528 footprint=163907832
	2010/12/03 14:51:32 bytes=46282224 footprint=163907832

	The different numbers for unique words/spots stem from the fact the the
	two workspaces are not exactly identical. The new godoc maintains a large
	file set data structure during indexing which (probably) is the reason
	for the larger heap (90858456 vs 66404528) before garbage collection.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3050041
2010-12-06 14:23:18 -08:00
Russ Cox
0db8d3df4c gc: select receive with implicit conversion
Fixes #1172.

R=ken2
CC=golang-dev
https://golang.org/cl/2615041
2010-10-20 16:38:25 -04:00
Russ Cox
8599a83727 runtime: correct iteration of large map values
The hash_next_and_deref was a dreg from a
previous large value scheme.

Fixes #1163.

R=r, r2
CC=golang-dev
https://golang.org/cl/2369043
2010-10-06 11:54:41 -04:00
Russ Cox
a3c682267f gc: various bugs
Fixes #1016.
Fixes #1152.
Fixes #1153.

R=ken2
CC=golang-dev
https://golang.org/cl/2344042
2010-10-03 11:50:44 -04:00
Russ Cox
52d619cfdf gc: bug308
confused by using isddd for both ONAME and OCALL

Fixes #1136.

R=ken2
CC=golang-dev
https://golang.org/cl/2314043
2010-09-30 15:05:01 -04:00
Ian Lance Taylor
6866026c45 test: Add test which causes incorrect error from gccgo.
R=gri
CC=golang-dev
https://golang.org/cl/2220048
2010-09-24 17:07:42 -07:00
Russ Cox
2ee420fa5e ... changes
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04:00
Robert Griesemer
5667d82599 fix build
R=iant
CC=golang-dev, ken2
https://golang.org/cl/2182043
2010-09-15 17:00:00 -07:00
Russ Cox
c3900387db gc: bug306
Fixes #1040.

R=ken2
CC=golang-dev
https://golang.org/cl/2132047
2010-09-13 15:42:14 -04:00
Ian Lance Taylor
cc2157ed4f test: Recognize gccgo error messages.
bug299.go:16:2: error: expected field name
bug299.go:17:2: error: expected field name
bug299.go:18:3: error: expected field name
bug299.go:25:9: error: expected receiver name or type
bug299.go:26:10: error: expected receiver name or type
bug299.go:27:9: error: expected receiver name or type

R=rsc
CC=golang-dev
https://golang.org/cl/2150044
2010-09-08 13:58:09 -07:00
Ian Lance Taylor
2660161533 test: Match gccgo error messages.
bug298.go:10:2: error: expected declaration
bug298.go:10:25: error: expected ‘;’ or newline after top level declaration
bug298.go:10:25: error: expected declaration

R=rsc
CC=golang-dev
https://golang.org/cl/2156046
2010-09-08 13:57:12 -07:00
Ian Lance Taylor
ae2dc76335 test: Actually run bug296.
R=rsc
CC=golang-dev
https://golang.org/cl/2156045
2010-09-08 13:56:49 -07:00
Ian Lance Taylor
1331084c3d test: Match gccgo error messages.
bug284.go:33: error: invalid type conversion
bug284.go:36: error: invalid type conversion (cannot use type A2 as type A1)
bug284.go:37: error: invalid type conversion
bug284.go:38: error: invalid type conversion (cannot use type A1 as type A2)
bug284.go:56: error: invalid type conversion
bug284.go:59: error: invalid type conversion (cannot use type S2 as type S1)
bug284.go:60: error: invalid type conversion
bug284.go:61: error: invalid type conversion (cannot use type S1 as type S2)
bug284.go:71: error: invalid type conversion
bug284.go:74: error: invalid type conversion (cannot use type P2 as type P1)
bug284.go:75: error: invalid type conversion
bug284.go:76: error: invalid type conversion (cannot use type P1 as type P2)
bug284.go:96: error: invalid type conversion
bug284.go:99: error: invalid type conversion (cannot use type Q2 as type Q1)
bug284.go:101: error: invalid type conversion (cannot use type Q1 as type Q2)
bug284.go:111: error: invalid type conversion (different parameter types)
bug284.go:114: error: invalid type conversion (different parameter types)
bug284.go:115: error: invalid type conversion (different parameter types)
bug284.go:116: error: invalid type conversion (different parameter types)
bug284.go:134: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:137: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:138: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:139: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:149: error: invalid type conversion
bug284.go:152: error: invalid type conversion (cannot use type L2 as type L1)
bug284.go:153: error: invalid type conversion
bug284.go:154: error: invalid type conversion (cannot use type L1 as type L2)
bug284.go:164: error: invalid type conversion
bug284.go:167: error: invalid type conversion (cannot use type L2 as type L1)
bug284.go:168: error: invalid type conversion
bug284.go:169: error: invalid type conversion (cannot use type L1 as type L2)
bug284.go:179: error: invalid type conversion
bug284.go:182: error: invalid type conversion (cannot use type C2 as type C1)
bug284.go:183: error: invalid type conversion
bug284.go:184: error: invalid type conversion (cannot use type C1 as type C2)

R=rsc
CC=golang-dev
https://golang.org/cl/2136041
2010-09-01 21:05:31 -07:00
Ian Lance Taylor
c28525a137 test: Recognize gccgo error messages.
bug278.go:18: error: invalid left hand side of assignment
bug278.go:19: error: array is not addressable
bug278.go:21: error: invalid left hand side of assignment
bug278.go:22: error: invalid left hand side of assignment

R=rsc
CC=golang-dev
https://golang.org/cl/2122042
2010-09-01 21:04:57 -07:00
Ian Lance Taylor
426275d702 test: Use global variables to defeat gccgo optimizer.
The gccgo compiler is smart enough to not make something which
is not used.  Use global variables to defeat this
optimization.

R=rsc
CC=golang-dev
https://golang.org/cl/2129041
2010-09-01 13:40:20 -07:00
Ian Lance Taylor
9bd6b0afa4 test: Recognize gccgo error messages.
bug255.go:11: error: array bound truncated to integer
bug255.go:12: error: array bound is not numeric
bug255.go:13: error: array bound is not numeric
bug255.go:14: error: array bound is not constant
bug255.go:15: error: array bound overflows

R=rsc
CC=golang-dev
https://golang.org/cl/2091042
2010-08-31 17:38:11 -07:00
Ian Lance Taylor
7a05b0f235 test: Match gccgo error messages.
Another case where gccgo and gc report similar but not
identical errors for a recursive interface.

bug251.go:11: error: invalid recursive interface

R=rsc
CC=golang-dev
https://golang.org/cl/2094041
2010-08-31 15:48:04 -07:00
Ian Lance Taylor
09977734cd test: gccgo and gc print the error on different lines.
This introduces GC_ERROR to mark an error only issued by the
gc compiler.  GCCGO_ERROR already exists to mark errors only
issued by the gccgo compiler.  Obviously these should be used
sparingly.

bug195.go:9: error: interface contains embedded non-interface
bug195.go:12: error: interface contains embedded non-interface
bug195.go:15: error: interface contains embedded non-interface
bug195.go:18: error: invalid recursive interface
bug195.go:22: error: invalid recursive interface

R=rsc
CC=golang-dev
https://golang.org/cl/2040043
2010-08-31 14:12:23 -07:00
Ian Lance Taylor
5309fae1a3 test: don't assign address of array to slice.
R=rsc
CC=golang-dev
https://golang.org/cl/2084042
2010-08-31 07:34:01 -07:00
Ian Lance Taylor
58a25c6de7 test: Add testcase which crashes gccgo.
R=rsc
CC=golang-dev
https://golang.org/cl/1995050
2010-08-24 13:08:05 -07:00
Russ Cox
1d77ff5b6b 6g, 8g: handle slice by sub-word-sized index (uint8, int8, uint16, int16)
R=ken2
CC=golang-dev
https://golang.org/cl/1960042
2010-08-11 22:27:47 -07:00
Russ Cox
26dde76cee gopack: handle long lines in export data
Also, if the header is bad, exit with a non-zero status.

Other calls to Brdline in the tree, by category:

Reading symbol name from object file:
./cmd/5l/obj.c:486: 		name = Brdline(f, '\0');
./cmd/6l/obj.c:535: 		name = Brdline(f, '\0');
./cmd/8l/obj.c:564: 		name = Brdline(f, '\0');
./libmach/sym.c:292: 		cp = Brdline(bp, '\0');

Reading archive header line (fixed, short):
./cmd/gc/lex.c:287: 	if((a = Brdline(b, '\n')) == nil)
./cmd/gc/lex.c:303: 	if((p = Brdline(b, '\n')) == nil)

Reading object file header line (fixed, short):
./cmd/ld/lib.c:421: 	line = Brdline(f, '\n');

Reading undefined symbol list (unused code):
./cmd/ld/lib.c:773: 	while((l = Brdline(b, '\n')) != nil){

Implementing Brdstr:
./libbio/brdstr.c:36: 		p = Brdline(bp, delim);

The symbol names ones will cause a problem loudly if they
fail: they'll error out with symbol name too long.  This means
that you can't define an enormous struct without giving the
type a name and then stick it in an interface, because the
type's symbol name will be too long for the object file.
Since this will be a loud failure instead of a silent one,
I'm willing to wait until it comes up in practice.

R=r
CC=golang-dev
https://golang.org/cl/1982041
2010-08-11 22:17:20 -07:00
Russ Cox
a9a62eef6b gc: bug302
Fixed by http://code.google.com/p/go/source/detail?r=d1f41e20a90e
This just adds a test and checks the return value of Bprint.

R=ken2
CC=golang-dev
https://golang.org/cl/1949042
2010-08-10 17:39:38 -07:00
Russ Cox
585eae3bce gc: bug301
Fixes #990.

R=ken2
CC=golang-dev
https://golang.org/cl/1742055
2010-08-03 01:07:40 -07:00
Russ Cox
c6cb303a8a gc: bug299, bug300
R=ken2
CC=golang-dev
https://golang.org/cl/1731057
2010-08-03 00:53:32 -07:00
Russ Cox
f20c2e1cf5 gc: more crash avoidance
Fixes #961.
Fixes #962.

R=ken2
CC=golang-dev
https://golang.org/cl/1903043
2010-07-26 17:34:17 -07:00
Russ Cox
607eaea456 gc: fix smaller-than-pointer-sized receivers in interfaces
Fixes #812.

R=ken2
CC=golang-dev
https://golang.org/cl/1904041
2010-07-26 15:25:10 -07:00
Russ Cox
7b240e8135 gc: import dot shadowing bug
R=ken2
CC=golang-dev
https://golang.org/cl/1873047
2010-07-26 14:21:39 -07:00
Russ Cox
4c0de303ce gc: bug294
Fixes #800.

R=ken2
CC=golang-dev
https://golang.org/cl/1855043
2010-07-15 16:42:32 -07:00
Russ Cox
ece6a8c549 gc: bug293
Fixes #846.

R=ken2
CC=golang-dev
https://golang.org/cl/1862042
2010-07-15 16:14:06 -07:00
Russ Cox
cdb446feb5 gc: bug292
Fixes #843.

R=ken2
CC=golang-dev
https://golang.org/cl/1729051
2010-07-15 16:13:47 -07:00
Russ Cox
08a263a991 gc: bug291
Fixes #915.

R=ken2
CC=golang-dev
https://golang.org/cl/1856042
2010-07-15 15:17:42 -07:00
Russ Cox
691d765121 gc: bug274
R=ken2
CC=golang-dev
https://golang.org/cl/1742044
2010-07-15 15:05:56 -07:00
Russ Cox
17f90c68c6 gc: fix handling of types inside function bodies
Fixes #849.
Fixes #920.

R=ken2
CC=golang-dev
https://golang.org/cl/1841042
2010-07-15 14:25:50 -07:00
Robert Griesemer
bebd22f8e0 fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1815042
2010-07-12 14:53:28 -07:00
Vinu Rajashekhar
89192ce4fe test/fixedbugs/bug243.go: instead of closing stdout,
remove the print statements.

This change is because of the port of gccgo to RTEMS.
These tests use the GCC DejaGNU framework. In some cases,
the tests need to be run on qemu where the status code
cannot be sent back to DejaGNU, so it prints the exit status
by putting a wrapper around the exit and abort calls.

This testcase closes the stdout, and hence prohibits DejaGNU
from knowing the status in such cases, and causes this test
to be wrongly declared as a failure.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/1792042
2010-07-12 13:17:32 -07:00
Ian Lance Taylor
e03a50dd11 Test case that gccgo fails (crashes rather than printing error).
R=rsc
CC=Raj_, golang-dev
https://golang.org/cl/1740044
2010-07-12 06:34:36 -07:00
Russ Cox
7c9ed7946c 8g: out of register bug fix
Fixes #868.

R=ken2
CC=golang-dev
https://golang.org/cl/1695049
2010-06-30 20:45:50 -07:00
Russ Cox
8bd99ebff5 test: another listen on ":0" -> "127.0.0.1:0"
R=r
CC=golang-dev
https://golang.org/cl/1664043
2010-06-21 16:34:55 -07:00
Russ Cox
6672b40c09 remove uses of ... from tree, add one test
R=r
CC=golang-dev
https://golang.org/cl/1662041
2010-06-14 11:23:11 -07:00
Russ Cox
565b5dc076 gc: new typechecking rules
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
  interface conversions from type assertions:
  convT2I, assertI2T, etc.
* Correct checking of \U sequences.

Fixes #840.
Fixes #830.
Fixes #778.

R=ken2
CC=golang-dev
https://golang.org/cl/1303042
2010-06-08 18:50:02 -07:00
Russ Cox
6aaef04469 misc cleanup: gofmt + &x -> x[0:] conversion
R=gri
CC=golang-dev
https://golang.org/cl/1620042
2010-06-08 17:51:57 -07:00
Russ Cox
6a060200cc 8g: out of register bug
Fixes #806.

R=ken2
CC=golang-dev
https://golang.org/cl/1281042
2010-05-24 17:22:51 -07:00