]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
9 years agogo1.3 go1.3
Andrew Gerrand [Thu, 19 Jun 2014 00:20:01 +0000 (10:20 +1000)]
go1.3

LGTM=rsc
R=golang-codereviews, minux, rsc
CC=golang-codereviews
https://golang.org/cl/104250043

9 years agodoc: document Go 1.3
Andrew Gerrand [Wed, 18 Jun 2014 23:54:26 +0000 (09:54 +1000)]
doc: document Go 1.3

TBR=r
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/101370043

9 years ago[release-branch.go1.3] fmt: fix signs when zero padding.
Andrew Gerrand [Wed, 18 Jun 2014 23:54:17 +0000 (09:54 +1000)]
[release-branch.go1.3] fmt: fix signs when zero padding.

««« CL 103480043 / 777dd5a434db
fmt: fix signs when zero padding.
Bug was introduced recently. Add more tests, fix the bugs.
Suppress + sign when not required in zero padding.
Do not zero pad infinities.
All old tests still pass.
This time for sure!
Fixes #8217.

LGTM=rsc
R=golang-codereviews, dan.kortschak, rsc
CC=golang-codereviews
https://golang.org/cl/103480043
»»»

LGTM=r, rsc
R=r, rsc
CC=golang-codereviews
https://golang.org/cl/110040043

9 years ago[release-branch.go1.3] go/build: update doc.go for go1.3 build tag.
Russ Cox [Wed, 18 Jun 2014 16:05:24 +0000 (09:05 -0700)]
[release-branch.go1.3] go/build: update doc.go for go1.3 build tag.

««« CL 102470045 / f15ad332ce13
go/build: update doc.go for go1.3 build tag.

LGTM=bradfitz
R=adg, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/102470045

»»»

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/105310044

9 years ago[release-branch.go1.3] doc: link to new downloads page
Andrew Gerrand [Tue, 17 Jun 2014 22:47:25 +0000 (08:47 +1000)]
[release-branch.go1.3] doc: link to new downloads page

««« CL 102340044 / 951cc5f6d52f
doc: link to new downloads page

LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/102340044
»»»

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/105300045

9 years ago[release-branch.go1.3] doc: add release note for 'godoc -analysis'
Andrew Gerrand [Tue, 17 Jun 2014 22:46:31 +0000 (08:46 +1000)]
[release-branch.go1.3] doc: add release note for 'godoc -analysis'

««« CL 88560044 / d011c0dcae9c
doc: add release note for 'godoc -analysis'

Contains a link to /lib/godoc/analysis/help.html
which is not yet live.

LGTM=r
R=r, adg
CC=golang-codereviews
https://golang.org/cl/88560044
»»»

TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/104150043

9 years agogo1.3rc2 go1.3rc2
Andrew Gerrand [Fri, 13 Jun 2014 03:24:50 +0000 (13:24 +1000)]
go1.3rc2

LGTM=minux, rsc
R=golang-codereviews, minux, rsc
CC=golang-codereviews
https://golang.org/cl/105170044

9 years ago[release-branch.go1.3] runtime: revise CL 105140044 (defer nil) to work on Windows
Russ Cox [Fri, 13 Jun 2014 01:52:52 +0000 (21:52 -0400)]
[release-branch.go1.3] runtime: revise CL 105140044 (defer nil) to work on Windows

««« CL 105120044 / 824ea5943ba8
runtime: revise CL 105140044 (defer nil) to work on Windows

It appears that something about Go on Windows
cannot handle the fault cause by a jump to address 0.
The way Go represents and calls functions, this
never happened at all, until CL 105140044.

This CL changes the code added in CL 105140044
to make jump to 0 impossible once again.

Fixes #8047. (again, on Windows)

TBR=bradfitz
R=golang-codereviews, dave
CC=adg, golang-codereviews, iant, r
https://golang.org/cl/105120044
»»»

LGTM=bradfitz
R=golang-codereviews, bradfitz, alex.brainman
CC=adg, golang-codereviews
https://golang.org/cl/108890045

9 years agorevert go1.3rc2
Andrew Gerrand [Fri, 13 Jun 2014 00:12:29 +0000 (10:12 +1000)]
revert go1.3rc2

The Windows build is still bad. The previous CL is not go1.3rc2.

TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/107050043

9 years agogo1.3rc2
Andrew Gerrand [Thu, 12 Jun 2014 23:41:58 +0000 (09:41 +1000)]
go1.3rc2

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/103420043

9 years ago[release-branch.go1.3] runtime: do not trace past jmpdefer during pprof traceback...
Russ Cox [Thu, 12 Jun 2014 20:55:36 +0000 (16:55 -0400)]
[release-branch.go1.3] runtime: do not trace past jmpdefer during pprof traceback on arm

««« CL 107970043 / b336da131a84
runtime: do not trace past jmpdefer during pprof traceback on arm

jmpdefer modifies PC, SP, and LR, and not atomically,
so walking past jmpdefer will often end up in a state
where the three are not a consistent execution snapshot.
This was causing warning messages a few frames later
when the traceback realized it was confused, but given
the right memory it could easily crash instead.

Update #8153

LGTM=minux, iant
R=golang-codereviews, minux, iant
CC=golang-codereviews, r
https://golang.org/cl/107970043
»»»

LGTM=r
R=golang-codereviews, r
CC=adg, golang-codereviews, iant
https://golang.org/cl/101260043

9 years ago[release-branch.go1.3] runtime: fix defer of nil func
Russ Cox [Thu, 12 Jun 2014 20:55:24 +0000 (16:55 -0400)]
[release-branch.go1.3] runtime: fix defer of nil func

««« CL 105140044 / c2832405e9b9
runtime: fix defer of nil func

Fixes #8047.

LGTM=r, iant
R=golang-codereviews, r, iant
CC=dvyukov, golang-codereviews, khr
https://golang.org/cl/105140044
»»»

LGTM=r
R=golang-codereviews, r
CC=adg, golang-codereviews, iant
https://golang.org/cl/103370044

9 years ago[release-branch.go1.3] doc: link to release history from /doc/
Russ Cox [Thu, 12 Jun 2014 20:55:11 +0000 (16:55 -0400)]
[release-branch.go1.3] doc: link to release history from /doc/

««« CL 107950043 / 593f58ee96da
doc: link to release history from /doc/

Fixes #8168.

TBR=bradfitz
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/107950043
»»»

LGTM=r
R=golang-codereviews, r
CC=adg, golang-codereviews, iant
https://golang.org/cl/105910043

9 years ago[release-branch.go1.3] runtime: add test for issue 8047.
Russ Cox [Thu, 12 Jun 2014 00:42:13 +0000 (20:42 -0400)]
[release-branch.go1.3] runtime: add test for issue 8047.

««« CL 108840043 / 3a2306461574
runtime: add test for issue 8047.

Make sure stack copier doesn't barf on a nil defer.
Bug was fixed in https://golang.org/cl/101800043
This change just adds a test.

Fixes #8047

LGTM=dvyukov, rsc
R=dvyukov, rsc
CC=golang-codereviews
https://golang.org/cl/108840043

»»»

TBR=adg
CC=golang-codereviews
https://golang.org/cl/102320043

10 years ago[release-branch.go1.3] net/http: fix double Content-Length in response
Russ Cox [Wed, 11 Jun 2014 21:02:43 +0000 (17:02 -0400)]
[release-branch.go1.3] net/http: fix double Content-Length in response

««« CL 105040043 / ef8878dbed3b
net/http: fix double Content-Length in response

Fixes #8180

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/105040043
»»»

TBR=bradfitz
R=golang-codereviews
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/102300046

10 years ago[release-branch.go1.3] doc/install.html: fix erroneous HTML annotation
Russ Cox [Wed, 11 Jun 2014 21:00:27 +0000 (17:00 -0400)]
[release-branch.go1.3] doc/install.html: fix erroneous HTML annotation

««« CL 106910044 / ac907318915d
doc/install.html: fix erroneous HTML annotation
align=middle is invalid; use align=center

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/106910044
»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/108860047

10 years ago[release-branch.go1.3] cmd/gc: two escape analysis fixes
Russ Cox [Wed, 11 Jun 2014 21:00:17 +0000 (17:00 -0400)]
[release-branch.go1.3] cmd/gc: two escape analysis fixes

««« CL 108860043 / f153208c0a0e
cmd/gc: fix escape analysis for &x inside switch x := v.(type)

The analysis for &x was using the loop depth on x set
during x's declaration. A type switch creates a list of
implicit declarations that were not getting initialized
with loop depths.

Fixes #8176.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/108860043
»»»

««« CL 108870044 / 331dbd4a6334
cmd/gc: fix &result escaping into result

There is a hierarchy of location defined by loop depth:

        -1 = the heap
        0 = function results
        1 = local variables (and parameters)
        2 = local variable declared inside a loop
        3 = local variable declared inside a loop inside a loop
        etc

In general if an address from loopdepth n is assigned to
something in loop depth m < n, that indicates an extended
lifetime of some form that requires a heap allocation.

Function results can be local variables too, though, and so
they don't actually fit into the hierarchy very well.
Treat the address of a function result as level 1 so that
if it is written back into a result, the address is treated
as escaping.

Fixes  issue 8185 .

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/108870044
»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/107930044

10 years ago[release-branch.go1.3] cmd/ld: fix PC deltas in DWARF line number table
Russ Cox [Wed, 11 Jun 2014 20:55:38 +0000 (16:55 -0400)]
[release-branch.go1.3] cmd/ld: fix PC deltas in DWARF line number table

««« CL 104950045 / 87daa424d96a
cmd/ld: fix PC deltas in DWARF line number table

The putpclcdelta function set the DWARF line number PC to
s->value + pcline->pc, which is correct, but the code then set
the local variable pc to epc, which can be a different value.
This caused the next delta in the DWARF table to be wrong.

Fixes #8098.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/104950045
»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/107900045

10 years ago[release-branch.go1.3] nacltest.bash, misc/nacl/README: update NaCl docs.
Russ Cox [Wed, 11 Jun 2014 20:55:24 +0000 (16:55 -0400)]
[release-branch.go1.3] nacltest.bash, misc/nacl/README: update NaCl docs.

««« CL 105030043 / 6146799f32ed
nacltest.bash, misc/nacl/README: update NaCl docs.

LGTM=rsc
R=dave, rsc
CC=golang-codereviews
https://golang.org/cl/105030043
»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/105020044

10 years ago[release-branch.go1.3] docs: link to the assembler document from the Documents tab
Russ Cox [Wed, 11 Jun 2014 20:55:04 +0000 (16:55 -0400)]
[release-branch.go1.3] docs: link to the assembler document from the Documents tab

««« CL 108840045 / 087e446f2c41
docs: link to the assembler document from the Documents tab

Fixes #8156.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/108840045
»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/101170045

10 years ago[release-branch.go1.3] runtime: fix panic stack during runtime.Goexit during panic
Russ Cox [Sat, 7 Jun 2014 02:07:32 +0000 (22:07 -0400)]
[release-branch.go1.3] runtime: fix panic stack during runtime.Goexit during panic

««« CL 102220043 / 00224712f89e
runtime: fix panic stack during runtime.Goexit during panic

A runtime.Goexit during a panic-invoked deferred call
left the panic stack intact even though all the stack frames
are gone when the goroutine is torn down.
The next goroutine to reuse that struct will have a
bogus panic stack and can cause the traceback routines
to walk into garbage.

Most likely to happen during tests, because t.Fatal might
be called during a deferred func and uses runtime.Goexit.

This "not enough cleared in Goexit" failure mode has
happened to us multiple times now. Clear all the pointers
that don't make sense to keep, not just gp->panic.

Fixes #8158.

LGTM=iant, dvyukov
R=iant, dvyukov
CC=golang-codereviews
https://golang.org/cl/102220043
»»»

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://golang.org/cl/108780044

10 years ago[release-branch.go1.3] cmd/6g: fix stack zeroing on native client
Russ Cox [Sat, 7 Jun 2014 02:07:21 +0000 (22:07 -0400)]
[release-branch.go1.3] cmd/6g: fix stack zeroing on native client

««« CL 108740047 / c8e9255aed3f
cmd/6g: fix stack zeroing on native client

I am not sure what the rounding here was
trying to do, but it was skipping the first
pointer on native client.

The code above the rounding already checks
that xoffset is widthptr-aligned, so the rnd
was a no-op everywhere but on Native Client.
And on Native Client it was wrong.

Perhaps it was supposed to be rounding down,
not up, but zerorange handles the extra 32 bits
correctly, so the rnd does not seem to be necessary
at all.

This wouldn't be worth doing for Go 1.3 except
that it can affect code on the playground.

Fixes #8155.

LGTM=r, iant
R=golang-codereviews, r, iant
CC=dvyukov, golang-codereviews, khr
https://golang.org/cl/108740047
»»»

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://golang.org/cl/107830044

10 years ago[release-branch.go1.3] doc: fix happens-before rules for buffered channels
Russ Cox [Sat, 7 Jun 2014 02:07:11 +0000 (22:07 -0400)]
[release-branch.go1.3] doc: fix happens-before rules for buffered channels

««« CL 101980047 / 12c9a9ff50d8
doc: fix happens-before rules for buffered channels
The current wording is reversed in 2 places.
Not sure how it got 4 LGTMs (mine was there as well).
Update #6242.

LGTM=dan.kortschak, r, rsc
R=golang-codereviews, 0xjnml, dan.kortschak, r, rsc
CC=golang-codereviews
https://golang.org/cl/101980047
»»»

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://golang.org/cl/106830047

10 years ago[release-branch.go1.3] cmd/cgo: for typedef of untagged struct, use typedef name...
Russ Cox [Sat, 7 Jun 2014 02:06:57 +0000 (22:06 -0400)]
[release-branch.go1.3] cmd/cgo: for typedef of untagged struct, use typedef name in C code

««« CL 103080043 / 5e058e21b67d
cmd/cgo: for typedef of untagged struct, use typedef name in C code

Fixes #8148.

LGTM=cookieo9, rsc
R=rsc, cookieo9
CC=golang-codereviews
https://golang.org/cl/103080043
»»»

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://golang.org/cl/103900046

10 years ago[release-branch.go1.3] doc/install-source.html: document that GO386 will be auto...
Shenghou Ma [Thu, 5 Jun 2014 01:19:54 +0000 (21:19 -0400)]
[release-branch.go1.3] doc/install-source.html: document that GO386 will be auto-detected when building on both 386 and amd64.

««« CL 102150046 / ccf7893cc2f0
doc/install-source.html: document that GO386 will be auto-detected when building on both 386 and amd64.
Fixes #8152.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/102150046
»»»

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/105830044

10 years ago[release-branch.go1.3] debug/elf: support DWARF that needs relocs for 386
David Symonds [Wed, 4 Jun 2014 01:23:24 +0000 (11:23 +1000)]
[release-branch.go1.3] debug/elf: support DWARF that needs relocs for 386

««« CL 96680045 / 5439c77d4acb
debug/elf: support DWARF that needs relocs for 386

It's not clear how widespread this issue is, but we do have a
test case generated by a development version of clang.

I don't know whether this should go into 1.3 or not; happy to
hear arguments either way.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/96680045
»»»

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/102140043

10 years ago[release-branch.go1.3] compress/gzip: allow Reset on Reader without NewReader
David Symonds [Wed, 4 Jun 2014 01:21:08 +0000 (11:21 +1000)]
[release-branch.go1.3] compress/gzip: allow Reset on Reader without NewReader

««« CL 103020044 / 318b56ffe04b
compress/gzip: allow Reset on Reader without NewReader

Fixes #8126.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/103020044
»»»

TBR=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/105820043

10 years ago[release-branch.go1.3] crypto/tls: fix typo referencing the required Config field
Russ Cox [Tue, 3 Jun 2014 18:44:25 +0000 (14:44 -0400)]
[release-branch.go1.3] crypto/tls: fix typo referencing the required Config field

««« CL 107740043 / d86ec79a5f30
crypto/tls: fix typo referencing the required Config field

Thanks to Frithjof Schulze for noticing.

LGTM=adg
R=adg
CC=agl, golang-codereviews, r
https://golang.org/cl/107740043

»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/103020043

10 years ago[release-branch.go1.3] cmd/gc: fix escape analysis of func returning indirect of...
Russ Cox [Tue, 3 Jun 2014 18:42:14 +0000 (14:42 -0400)]
[release-branch.go1.3] cmd/gc: fix escape analysis of func returning indirect of parameter

««« CL 102040046 / a078b2056ebc
cmd/gc: fix escape analysis of func returning indirect of parameter

I introduced this bug when I changed the escape
analysis to run in phases based on call graph
dependency order, in order to be more precise about
inputs escaping back to outputs (functions returning
their arguments).

Given

        func f(z **int) *int { return *z }

we were tagging the function as 'z does not escape
and is not returned', which is all true, but not
enough information.

If used as:

        var x int
        p := &x
        q := &p
        leak(f(q))

then the compiler might try to keep x, p, and q all
on the stack, since (according to the recorded
information) nothing interesting ends up being
passed to leak.

In fact since f returns *q = p, &x is passed to leak
and x needs to be heap allocated.

To trigger the bug, you need a chain that the
compiler wants to keep on the stack (like x, p, q
above), and you need a function that returns an
indirect of its argument, and you need to pass the
head of the chain to that function. This doesn't
come up very often: this bug has been present since
June 2012 (between Go 1 and Go 1.1) and we haven't
seen it until now. It helps that most functions that
return indirects are getters that are simple enough
to be inlined, avoiding the bug.

Earlier versions of Go also had the benefit that if
&x really wasn't used beyond x's lifetime, nothing
broke if you put &x in a heap-allocated structure
accidentally. With the new stack copying, though,
heap-allocated structures containing &x are not
updated when the stack is copied and x moves,
leading to crashes in Go 1.3 that were not crashes
in Go 1.2 or Go 1.1.

The fix is in two parts.

First, in the analysis of a function, recognize when
a value obtained via indirect of a parameter ends up
being returned. Mark those parameters as having
content escape back to the return results (but we
don't bother to write down which result).

Second, when using the analysis to analyze, say,
f(q), mark parameters with content escaping as
having any indirections escape to the heap. (We
don't bother trying to match the content to the
return value.)

The fix could be less precise (simpler).
In the first part we might mark all content-escaping
parameters as plain escaping, and then the second
part could be dropped. Or we might assume that when
calling f(q) all the things pointed at by q escape
always (for any f and q).

The fix could also be more precise (more complex).
We might record the specific mapping from parameter
to result along with the number of indirects from the
parameter to the thing being returned as the result,
and then at the call sites we could set up exactly the
right graph for the called function. That would make
notleaks(f(q)) be able to keep x on the stack, because
the reuslt of f(q) isn't passed to anything that leaks it.

The less precise the fix, the more stack allocations
become heap allocations.

This fix is exactly as precise as it needs to be so that
none of the current stack allocations in the standard
library turn into heap allocations.

Fixes #8120.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, khr, r
https://golang.org/cl/102040046
»»»

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/103870043

10 years ago[release-branch.go1.3] time: support version 3 zone records
David Symonds [Tue, 3 Jun 2014 06:13:38 +0000 (16:13 +1000)]
[release-branch.go1.3] time: support version 3 zone records

««« CL 100930044 / fde405c62fca
time: support version 3 zone records

Fixes #8134

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r, rsc
https://golang.org/cl/100930044
»»»

LGTM=rsc
R=adg, rsc
CC=golang-codereviews
https://golang.org/cl/96690043

10 years ago[release-branch.go1.3] cmd/gc: fix liveness for address-taken variables in inlined...
David Symonds [Tue, 3 Jun 2014 01:30:20 +0000 (11:30 +1000)]
[release-branch.go1.3] cmd/gc: fix liveness for address-taken variables in inlined functions

««« CL 96670046 / 1bec455e95f1
cmd/gc: fix liveness for address-taken variables in inlined functions

The 'address taken' bit in a function variable was not
propagating into the inlined copies, causing incorrect
liveness information.

LGTM=dsymonds, bradfitz
R=golang-codereviews, bradfitz
CC=dsymonds, golang-codereviews, iant, khr, r
https://golang.org/cl/96670046
»»»

TBR=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/103810046

10 years ago[release-branch.go1.3] runtime: fix 1-byte return during x.(T) for 0-byte T
David Symonds [Tue, 3 Jun 2014 01:20:32 +0000 (11:20 +1000)]
[release-branch.go1.3] runtime: fix 1-byte return during x.(T) for 0-byte T

««« CL 100940043 / 93baf7bea171
runtime: fix 1-byte return during x.(T) for 0-byte T

The 1-byte write was silently clearing a byte on the stack.
If there was another function call with more arguments
in the same stack frame, no harm done.
Otherwise, if the variable at that location was already zero,
no harm done.
Otherwise, problems.

Fixes #8139.

LGTM=dsymonds
R=golang-codereviews, dsymonds
CC=golang-codereviews, iant, r
https://golang.org/cl/100940043
»»»

TBR=adg
CC=golang-codereviews
https://golang.org/cl/105760045

10 years ago[release-branch.go1.3] cmd/gc: don't generate zillions of linehists for wrapper functions
David Symonds [Tue, 3 Jun 2014 01:19:11 +0000 (11:19 +1000)]
[release-branch.go1.3] cmd/gc: don't generate zillions of linehists for wrapper functions

««« CL 104840043 / 876107512a67
cmd/gc: don't generate zillions of linehists for wrapper functions
This is a workaround - the code should be better than this - but the
fix avoids generating large numbers of linehist entries for the wrapper
functions that enable interface conversions. There can be many of
them, they all happen at the end of compilation, and they can all
share a linehist entry.
Avoids bad n^2 behavior in liblink.
Test case in issue 8135 goes from 64 seconds to 2.5 seconds (still bad
but not intolerable).

Fixes #8135.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/104840043
»»»

TBR=adg
CC=golang-codereviews
https://golang.org/cl/102070045

10 years ago[release-branch.go1.3] cmd/cgo: use same Go type for typedef to anonymous struct
David Symonds [Tue, 3 Jun 2014 01:18:01 +0000 (11:18 +1000)]
[release-branch.go1.3] cmd/cgo: use same Go type for typedef to anonymous struct

««« CL 102080043 / 256d975c53cb
cmd/cgo: use same Go type for typedef to anonymous struct

If we see a typedef to an anonymous struct more than once,
presumably in two different Go files that import "C", use the
same Go type name.

Fixes #8133.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/102080043
»»»

TBR=adg
CC=golang-codereviews
https://golang.org/cl/102100043

10 years ago[release-branch.go1.3] doc: mention WriteHeapDump in 1.3 release notes
David Symonds [Tue, 3 Jun 2014 01:16:35 +0000 (11:16 +1000)]
[release-branch.go1.3] doc: mention WriteHeapDump in 1.3 release notes

««« CL 103810044 / 603f6c3b152c
doc: mention WriteHeapDump in 1.3 release notes

LGTM=r
R=khr, r
CC=golang-codereviews
https://golang.org/cl/103810044
»»»

TBR=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/99700043

10 years agogo1.3rc1 go1.3rc1
Andrew Gerrand [Mon, 2 Jun 2014 04:34:50 +0000 (14:34 +1000)]
go1.3rc1

LGTM=minux
R=golang-codereviews, minux
CC=golang-codereviews
https://golang.org/cl/102920050

10 years ago[release-branch.go1.3] misc/nacl: remove cmd/link from testzip.proto
Andrew Gerrand [Mon, 2 Jun 2014 03:37:16 +0000 (13:37 +1000)]
[release-branch.go1.3] misc/nacl: remove cmd/link from testzip.proto

There's no cmd/link in this branch.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/102050043

10 years ago[release-branch.go1.3] remove package debug/goobj and copy functionality to cmd/nm
Andrew Gerrand [Mon, 2 Jun 2014 03:04:43 +0000 (13:04 +1000)]
[release-branch.go1.3] remove package debug/goobj and copy functionality to cmd/nm

https://golang.org/cl/103760043/

10 years ago[release-branch.go1.3] remove cmd/link
Andrew Gerrand [Mon, 2 Jun 2014 03:04:00 +0000 (13:04 +1000)]
[release-branch.go1.3] remove cmd/link

https://golang.org/cl/106740043

10 years agodoc/contrib.html: update links, mailing lists and link to 1.3 release note.
Shenghou Ma [Mon, 2 Jun 2014 02:48:57 +0000 (22:48 -0400)]
doc/contrib.html: update links, mailing lists and link to 1.3 release note.

LGTM=adg
R=golang-codereviews, r, adg
CC=golang-codereviews
https://golang.org/cl/102020045

10 years agomisc/makerelease: report uploads to the new downloads page
Andrew Gerrand [Mon, 2 Jun 2014 02:46:03 +0000 (12:46 +1000)]
misc/makerelease: report uploads to the new downloads page

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/102040047

10 years agoapi: add go1.3.txt
Brad Fitzpatrick [Mon, 2 Jun 2014 02:45:00 +0000 (11:45 +0900)]
api: add go1.3.txt

Update #8112

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/104790045

10 years agobuild: don't build goplay in run.rc.
Shenghou Ma [Sun, 1 Jun 2014 23:20:46 +0000 (19:20 -0400)]
build: don't build goplay in run.rc.
Fix plan 9 build.

TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/100880047

10 years agocmd/objdump: add arm disassembler
Russ Cox [Sun, 1 Jun 2014 22:53:59 +0000 (18:53 -0400)]
cmd/objdump: add arm disassembler

Fixes #7452.

LGTM=minux, iant
R=minux, iant
CC=golang-codereviews
https://golang.org/cl/104770046

10 years agocmd/dist: only use beta tag in version string for the exact revision
Andrew Gerrand [Sun, 1 Jun 2014 22:48:20 +0000 (08:48 +1000)]
cmd/dist: only use beta tag in version string for the exact revision

Right now, any revision on the default branch after go1.3beta2 is
described by "go verson" as go1.3beta2 plus some revision.
That's OK for now, but once go1.3 is released, that will seem wrong.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/98650046

10 years agobuild: remove goplay from run.bash and run.bat
Andrew Gerrand [Sun, 1 Jun 2014 22:44:47 +0000 (08:44 +1000)]
build: remove goplay from run.bash and run.bat

TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/106730043

10 years agomisc/goplay: remove program
Andrew Gerrand [Sun, 1 Jun 2014 22:34:26 +0000 (08:34 +1000)]
misc/goplay: remove program

This program has barely been touched since it was first committed,
and in its current state it opens a code execution vector similar
to the one that was recently fixed in go.tools/playground/socket.

Rather than try to make it secure, remove it.

LGTM=minux, rsc
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/102030047

10 years agoruntime: fix correctness test at end of traceback
Russ Cox [Sun, 1 Jun 2014 17:57:46 +0000 (13:57 -0400)]
runtime: fix correctness test at end of traceback

We were requiring that the defer stack and the panic stack
be completely processed, thinking that if any were left over
the stack scan and the defer stack/panic stack must be out
of sync. It turns out that the panic stack may well have
leftover entries in some situations, and that's okay.

Fixes #8132.

LGTM=minux, r
R=golang-codereviews, minux, r
CC=golang-codereviews, iant, khr
https://golang.org/cl/100900044

10 years agolib/timezone: update to IANA 2014d
Rob Pike [Sun, 1 Jun 2014 00:15:23 +0000 (00:15 +0000)]
lib/timezone: update to IANA 2014d

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/102040045

10 years agoruntime: mark some C globals as having no pointers.
Keith Randall [Sat, 31 May 2014 23:21:17 +0000 (19:21 -0400)]
runtime: mark some C globals as having no pointers.

C globals are conservatively scanned.  This helps
avoid false retention, especially for 32 bit.

LGTM=rsc
R=golang-codereviews, khr, rsc
CC=golang-codereviews
https://golang.org/cl/102040043

10 years agoruntime: make continuation pc available to stack walk
Russ Cox [Sat, 31 May 2014 14:10:12 +0000 (10:10 -0400)]
runtime: make continuation pc available to stack walk

The 'continuation pc' is where the frame will continue
execution, if anywhere. For a frame that stopped execution
due to a CALL instruction, the continuation pc is immediately
after the CALL. But for a frame that stopped execution due to
a fault, the continuation pc is the pc after the most recent CALL
to deferproc in that frame, or else 0. That is where execution
will continue, if anywhere.

The liveness information is only recorded for CALL instructions.
This change makes sure that we never look for liveness information
except for CALL instructions.

Using a valid PC fixes crashes when a garbage collection or
stack copying tries to process a stack frame that has faulted.

Record continuation pc in heapdump (format change).

Fixes #8048.

LGTM=iant, khr
R=khr, iant, dvyukov
CC=golang-codereviews, r
https://golang.org/cl/100870044

10 years agocmd/gc: fix handling of for post-condition in -race mode
Russ Cox [Sat, 31 May 2014 13:35:54 +0000 (09:35 -0400)]
cmd/gc: fix handling of for post-condition in -race mode

Fixes #8102.

LGTM=bradfitz, dvyukov
R=golang-codereviews, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/100870046

10 years agoruntime: fix error check in freebsd/386 i386_set_ldt
Russ Cox [Sat, 31 May 2014 13:35:37 +0000 (09:35 -0400)]
runtime: fix error check in freebsd/386 i386_set_ldt

Update #2675

The code here was using the error check for Linux/386,
not the one for FreeBSD/386. Most of the time it worked.

Thanks to Neel Natu (FreeBSD developer) for finding this.

The s/JCC/JAE/ a few lines later is a no-op but makes the
test match the rest of the file. Why we write JAE instead of JCC
I don't know, but the two are equivalent and the file might
as well be consistent.

LGTM=bradfitz, minux
R=golang-codereviews, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/99680044

10 years agoruntime/debug: skip TestWriteHeapDumpNonempty on NaCl.
Shenghou Ma [Sat, 31 May 2014 09:30:01 +0000 (02:30 -0700)]
runtime/debug: skip TestWriteHeapDumpNonempty on NaCl.
TestWriteHeap is useless on NaCl anyway.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/101980048

10 years agoC: add another email of mine.
Shenghou Ma [Sat, 31 May 2014 08:55:11 +0000 (01:55 -0700)]
C: add another email of mine.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/102920047

10 years agoruntime: fix empty heap dump bug on windows.
Shenghou Ma [Sat, 31 May 2014 08:09:48 +0000 (01:09 -0700)]
runtime: fix empty heap dump bug on windows.
Fixes #8119.

LGTM=khr, rsc
R=alex.brainman, khr, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/93640044

10 years agocmd/cgo: document the cgo types also follow Go name space rules.
Shenghou Ma [Sat, 31 May 2014 07:51:46 +0000 (00:51 -0700)]
cmd/cgo: document the cgo types also follow Go name space rules.
Fixes #7958.

LGTM=rsc
R=golang-codereviews, rsc, r, gobot
CC=golang-codereviews
https://golang.org/cl/91520043

10 years agocmd/6g: treat vardef-initialized fat variables as live at calls
Russ Cox [Fri, 30 May 2014 20:41:58 +0000 (16:41 -0400)]
cmd/6g: treat vardef-initialized fat variables as live at calls

This CL forces the optimizer to preserve some memory stores
that would be redundant except that a stack scan due to garbage
collection or stack copying might look at them during a function call.
As such, it forces additional memory writes and therefore slows
down the execution of some programs, especially garbage-heavy
programs that are already limited by memory bandwidth.

The slowdown can be as much as 7% for end-to-end benchmarks.

These numbers are from running go1.test -test.benchtime=5s three times,
taking the best (lowest) ns/op for each benchmark. I am excluding
benchmarks with time/op < 10us to focus on macro effects.
All benchmarks are on amd64.

Comparing tip (a27f34c771cb) against this CL on an Intel Core i5 MacBook Pro:

benchmark                          old ns/op      new ns/op      delta
BenchmarkBinaryTree17              3876500413     3856337341     -0.52%
BenchmarkFannkuch11                2965104777     2991182127     +0.88%
BenchmarkGobDecode                 8563026        8788340        +2.63%
BenchmarkGobEncode                 5050608        5267394        +4.29%
BenchmarkGzip                      431191816      434168065      +0.69%
BenchmarkGunzip                    107873523      110563792      +2.49%
BenchmarkHTTPClientServer          85036          86131          +1.29%
BenchmarkJSONEncode                22143764       22501647       +1.62%
BenchmarkJSONDecode                79646916       85658808       +7.55%
BenchmarkMandelbrot200             4720421        4700108        -0.43%
BenchmarkGoParse                   4651575        4712247        +1.30%
BenchmarkRegexpMatchMedium_1K      71986          73490          +2.09%
BenchmarkRegexpMatchHard_1K        111018         117495         +5.83%
BenchmarkRevcomp                   648798723      659352759      +1.63%
BenchmarkTemplate                  112673009      112819078      +0.13%

Comparing tip (a27f34c771cb) against this CL on an Intel Xeon E5520:

BenchmarkBinaryTree17              5461110720     5393104469     -1.25%
BenchmarkFannkuch11                4314677151     4327177615     +0.29%
BenchmarkGobDecode                 11065853       11235272       +1.53%
BenchmarkGobEncode                 6500065        6959837        +7.07%
BenchmarkGzip                      647478596      671769097      +3.75%
BenchmarkGunzip                    139348579      141096376      +1.25%
BenchmarkHTTPClientServer          69376          73610          +6.10%
BenchmarkJSONEncode                30172320       31796106       +5.38%
BenchmarkJSONDecode                113704905      114239137      +0.47%
BenchmarkMandelbrot200             6032730        6003077        -0.49%
BenchmarkGoParse                   6775251        6405995        -5.45%
BenchmarkRegexpMatchMedium_1K      111832         113895         +1.84%
BenchmarkRegexpMatchHard_1K        161112         168420         +4.54%
BenchmarkRevcomp                   876363406      892319935      +1.82%
BenchmarkTemplate                  146273096      148998339      +1.86%

Just to get a sense of where we are compared to the previous release,
here are the same benchmarks comparing Go 1.2 to this CL.

Comparing Go 1.2 against this CL on an Intel Core i5 MacBook Pro:

BenchmarkBinaryTree17              4370077662     3856337341     -11.76%
BenchmarkFannkuch11                3347052657     2991182127     -10.63%
BenchmarkGobDecode                 8791384        8788340        -0.03%
BenchmarkGobEncode                 4968759        5267394        +6.01%
BenchmarkGzip                      437815669      434168065      -0.83%
BenchmarkGunzip                    94604099       110563792      +16.87%
BenchmarkHTTPClientServer          87798          86131          -1.90%
BenchmarkJSONEncode                22818243       22501647       -1.39%
BenchmarkJSONDecode                97182444       85658808       -11.86%
BenchmarkMandelbrot200             4733516        4700108        -0.71%
BenchmarkGoParse                   5054384        4712247        -6.77%
BenchmarkRegexpMatchMedium_1K      67612          73490          +8.69%
BenchmarkRegexpMatchHard_1K        107321         117495         +9.48%
BenchmarkRevcomp                   733270055      659352759      -10.08%
BenchmarkTemplate                  109304977      112819078      +3.21%

Comparing Go 1.2 against this CL on an Intel Xeon E5520:

BenchmarkBinaryTree17              5986953594     5393104469     -9.92%
BenchmarkFannkuch11                4861139174     4327177615     -10.98%
BenchmarkGobDecode                 11830997       11235272       -5.04%
BenchmarkGobEncode                 6608722        6959837        +5.31%
BenchmarkGzip                      661875826      671769097      +1.49%
BenchmarkGunzip                    138630019      141096376      +1.78%
BenchmarkHTTPClientServer          71534          73610          +2.90%
BenchmarkJSONEncode                30393609       31796106       +4.61%
BenchmarkJSONDecode                139645860      114239137      -18.19%
BenchmarkMandelbrot200             5988660        6003077        +0.24%
BenchmarkGoParse                   6974092        6405995        -8.15%
BenchmarkRegexpMatchMedium_1K      111331         113895         +2.30%
BenchmarkRegexpMatchHard_1K        165961         168420         +1.48%
BenchmarkRevcomp                   995049292      892319935      -10.32%
BenchmarkTemplate                  145623363      148998339      +2.32%

Fixes #8036.

LGTM=khr
R=golang-codereviews, josharian, khr
CC=golang-codereviews, iant, r
https://golang.org/cl/99660044

10 years agoruntime: add zero field to rtype
Ian Lance Taylor [Fri, 30 May 2014 14:56:05 +0000 (07:56 -0700)]
runtime: add zero field to rtype

The rtype struct is meant to be a copy of reflect.rtype.  The
zero field was added to reflect.rtype in 18495:6e50725ac753.

LGTM=rsc
R=khr, rsc
CC=golang-codereviews
https://golang.org/cl/93660045

10 years agocmd/gc: fix x=x crash
Russ Cox [Thu, 29 May 2014 17:47:31 +0000 (13:47 -0400)]
cmd/gc: fix x=x crash

[Same as CL 102820043 except applied changes to 6g/gsubr.c
also to 5g/gsubr.c and 8g/gsubr.c. The problem I had last night
trying to do that was that 8g's copy of nodarg has different
(but equivalent) control flow and I was pasting the new code
into the wrong place.]

Description from CL 102820043:

The 'nodarg' function is used to obtain a Node*
representing a function argument or result.
It returned a brand new Node*, but that violates
the guarantee in most places in the compiler that
two Node*s refer to the same variable if and only if
they are the same Node* pointer. Reestablish that
invariant by making nodarg return a preexisting
named variable if present.

Having fixed that, avoid any copy during x=x in
componentgen, because the VARDEF we emit
before the copy marks the lhs x as dead incorrectly.

The change in walk.c avoids modifying the result
of nodarg. This was the only place in the compiler
that did so.

Fixes #8097.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, iant, khr, r
https://golang.org/cl/103750043

10 years agoundo CL 102820043 / b0ce6dbafc18
Russ Cox [Thu, 29 May 2014 01:46:20 +0000 (21:46 -0400)]
undo CL 102820043 / b0ce6dbafc18

Breaks 386 and arm builds.
The obvious reason is that this CL only edited 6g/gsubr.c
and failed to edit 5g/gsubr.c and 8g/gsubr.c.
However, the obvious CL applying the same edit to those
files (CL 101900043) causes mysterious build failures
in various of the standard package tests, usually involving
reflect. Something deep and subtle is broken but only on
the 32-bit systems.

Undo this CL for now.

««« original CL description
cmd/gc: fix x=x crash

The 'nodarg' function is used to obtain a Node*
representing a function argument or result.
It returned a brand new Node*, but that violates
the guarantee in most places in the compiler that
two Node*s refer to the same variable if and only if
they are the same Node* pointer. Reestablish that
invariant by making nodarg return a preexisting
named variable if present.

Having fixed that, avoid any copy during x=x in
componentgen, because the VARDEF we emit
before the copy marks the lhs x as dead incorrectly.

The change in walk.c avoids modifying the result
of nodarg. This was the only place in the compiler
that did so.

Fixes #8097.

LGTM=r, khr
R=golang-codereviews, r, khr
CC=golang-codereviews, iant
https://golang.org/cl/102820043
»»»

TBR=r
CC=golang-codereviews, khr
https://golang.org/cl/95660043

10 years agocmd/gc: fix x=x crash
Russ Cox [Wed, 28 May 2014 23:50:19 +0000 (19:50 -0400)]
cmd/gc: fix x=x crash

The 'nodarg' function is used to obtain a Node*
representing a function argument or result.
It returned a brand new Node*, but that violates
the guarantee in most places in the compiler that
two Node*s refer to the same variable if and only if
they are the same Node* pointer. Reestablish that
invariant by making nodarg return a preexisting
named variable if present.

Having fixed that, avoid any copy during x=x in
componentgen, because the VARDEF we emit
before the copy marks the lhs x as dead incorrectly.

The change in walk.c avoids modifying the result
of nodarg. This was the only place in the compiler
that did so.

Fixes #8097.

LGTM=r, khr
R=golang-codereviews, r, khr
CC=golang-codereviews, iant
https://golang.org/cl/102820043

10 years agomisc/makerelease: upload files to Google Cloud Storage
Andrew Gerrand [Wed, 28 May 2014 22:40:15 +0000 (08:40 +1000)]
misc/makerelease: upload files to Google Cloud Storage

LGTM=bradfitz
R=jasonhall, bradfitz
CC=golang-codereviews
https://golang.org/cl/91700047

10 years agodoc/go1.3.html: math/big's Int and Rat implement TextMarshaler, TextUnmarshaler
Russ Cox [Wed, 28 May 2014 19:48:35 +0000 (15:48 -0400)]
doc/go1.3.html: math/big's Int and Rat implement TextMarshaler, TextUnmarshaler

Update #8112

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/95640043

10 years agoregexp: hide one-pass code from exported API
Russ Cox [Wed, 28 May 2014 18:08:44 +0000 (14:08 -0400)]
regexp: hide one-pass code from exported API

Update #8112

Hide one-pass regexp API.

This means moving the code from regexp/syntax to regexp,
but it avoids being locked into the specific API chosen for
the implementation.

It also removes a slice field from the syntax.Inst, which
should avoid bloating the memory footprint of a non-one-pass
regexp unnecessarily.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews, iant
https://golang.org/cl/98610046

10 years agocmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable
Russ Cox [Wed, 28 May 2014 18:04:31 +0000 (14:04 -0400)]
cmd/cgo: given typedef struct S T, make C.T and C.struct_S interchangeable

For incomplete struct S, C.T and C.struct_S were interchangeable in Go 1.2
and earlier, because all incomplete types were interchangeable
(even C.struct_S1 and C.struct_S2).

CL 76450043, which fixed issue 7409, made different incomplete types
different from Go's point of view, so that they were no longer completely
interchangeable.

However, imprecision about C.T and C.struct_S - really the same
underlying C type - is the one behavior enabled by the bug that
is most likely to be depended on by existing cgo code.
Explicitly allow it, to keep that code working.

Fixes #7786.

LGTM=iant, r
R=golang-codereviews, iant, r
CC=golang-codereviews
https://golang.org/cl/98580046

10 years agospec: clarify that break/continue do not work across function boundaries
Robert Griesemer [Wed, 28 May 2014 15:43:47 +0000 (08:43 -0700)]
spec: clarify that break/continue do not work across function boundaries

Also made it extra clear for goto statements (even though label scopes
are already limited to the function defining a label).

Fixes #8040.

LGTM=r, rsc
R=r, rsc, iant, ken
CC=golang-codereviews
https://golang.org/cl/99550043

10 years agomime: sort attributes in FormatMediaType
Brad Fitzpatrick [Wed, 28 May 2014 15:16:09 +0000 (08:16 -0700)]
mime: sort attributes in FormatMediaType

Map iteration order issue. Go 1.2 and earlier had stable results
for small maps.

Fixes #8115

LGTM=r, rsc
R=golang-codereviews, r
CC=dsymonds, golang-codereviews, iant, rsc
https://golang.org/cl/98580047

10 years agoapi: update next.txt
Brad Fitzpatrick [Wed, 28 May 2014 05:10:57 +0000 (22:10 -0700)]
api: update next.txt

LGTM=rsc
R=golang-codereviews, rsc
CC=adg, golang-codereviews
https://golang.org/cl/99530044

10 years agotest/run: limit parallelism to 1 for cross-exec builds
Russ Cox [Wed, 28 May 2014 05:01:08 +0000 (01:01 -0400)]
test/run: limit parallelism to 1 for cross-exec builds

This matters for NaCl, which seems to swamp my 4-core MacBook Pro otherwise.
It's not a correctness problem, just a usability problem.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/98600046

10 years agotest: expand issue7863 test
Russ Cox [Wed, 28 May 2014 04:53:39 +0000 (21:53 -0700)]
test: expand issue7863 test

This was sitting in my client but I forgot hg add.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/101800045

10 years agoruntime: fix go of nil func value
Dmitriy Vyukov [Wed, 28 May 2014 04:00:01 +0000 (00:00 -0400)]
runtime: fix go of nil func value
Currently runtime derefences nil with m->locks>0,
which causes unrecoverable fatal error.
Panic instead.
Fixes #8045.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews, khr
https://golang.org/cl/97620043

10 years agocmd/gc: fix race compilation failure 'non-orig name'
Russ Cox [Wed, 28 May 2014 03:59:27 +0000 (23:59 -0400)]
cmd/gc: fix race compilation failure 'non-orig name'

CL 51010045 fixed the first one of these:

        cmd/gc: return canonical Node* from temp

        For historical reasons, temp was returning a copy
        of the created Node*, not the original Node*.
        This meant that if analysis recorded information in the
        returned node (for example, n->addrtaken = 1), the
        analysis would not show up on the original Node*, the
        one kept in fn->dcl and consulted during liveness
        bitmap creation.

        Correct this, and watch for it when setting addrtaken.

        Fixes #7083.

        R=khr, dave, minux.ma
        CC=golang-codereviews
        https://golang.org/cl/51010045

CL 53200043 fixed the second:

        cmd/gc: fix race build

        Missed this case in CL 51010045.

        TBR=khr
        CC=golang-codereviews
        https://golang.org/cl/53200043

This CL fixes the third. There are only three nod(OXXX, ...)
calls in sinit.c, so maybe we're done. Embarassing that it
took three CLs to find all three.

Fixes #8028.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, iant
https://golang.org/cl/100800046

10 years agocmd/gc: fix defer copy(x, <-c)
Russ Cox [Wed, 28 May 2014 03:59:06 +0000 (23:59 -0400)]
cmd/gc: fix defer copy(x, <-c)

In the first very rough draft of the reordering code
that was introduced in the Go 1.3 cycle, the pre-allocated
temporary for a ... argument was held in n->right.
It moved to n->alloc but the code avoiding n->right
was left behind in order.c. In copy(x, <-c), the receive
is in n->right and must be processed. Delete the special
case code, removing the bug.

Fixes #8039.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/100820044

10 years agocmd/gc: fix infinite loop in nil check removal
Russ Cox [Wed, 28 May 2014 03:58:49 +0000 (23:58 -0400)]
cmd/gc: fix infinite loop in nil check removal

Fixes #8076.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/93610043

10 years agocmd/gc: fix method value closures on nacl amd64p32
Russ Cox [Wed, 28 May 2014 03:58:36 +0000 (23:58 -0400)]
cmd/gc: fix method value closures on nacl amd64p32

The code was assuming that pointer alignment is the
maximum alignment, but on NaCl uint64 alignment is
even more strict.

Brad checked in the test earlier today; this fixes the build.

Fixes #7863.

TBR=iant
CC=golang-codereviews
https://golang.org/cl/98630046

10 years agocmd/go: do not miss an error if import path contains "cmd/something"
Jan Ziak [Wed, 28 May 2014 03:58:03 +0000 (23:58 -0400)]
cmd/go: do not miss an error if import path contains "cmd/something"

Fixes #7638

LGTM=rsc
R=rsc, adg, robert.hencke, bradfitz
CC=golang-codereviews
https://golang.org/cl/89280043

10 years agocmd/gc: fix conversion of runtime constant
Russ Cox [Wed, 28 May 2014 01:38:19 +0000 (21:38 -0400)]
cmd/gc: fix conversion of runtime constant

The code cannot have worked before, because it was
trying to use the old value in a range check for the new
type, which might have a different representation
(hence the 'internal compiler error').

Fixes #8073.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/98630045

10 years agoruntime: stack copier should handle nil defers without faulting.
Keith Randall [Tue, 27 May 2014 23:26:08 +0000 (16:26 -0700)]
runtime: stack copier should handle nil defers without faulting.

fixes #8047

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/101800043

10 years agotest: add test for fixed issue 7863
Brad Fitzpatrick [Tue, 27 May 2014 23:01:43 +0000 (16:01 -0700)]
test: add test for fixed issue 7863

Fixes #7863

LGTM=rsc
R=rsc, ruiu
CC=golang-codereviews
https://golang.org/cl/98610045

10 years agocmd/go: improve error message when import path contains http://
Rob Pike [Tue, 27 May 2014 21:37:36 +0000 (14:37 -0700)]
cmd/go: improve error message when import path contains http://
Common mistake (at least for me) because hg etc. require the prefix
while the go command forbids it.

Before:
% go get http://code.google.com/p/go.text/unicode/norm
package http:/code.google.com/p/go.text/unicode/norm: unrecognized import path "http:/code.google.com/p/go.text/unicode/norm"

After:
% go get http://code.google.com/p/go.text/unicode/norm
package http:/code.google.com/p/go.text/unicode/norm: "http://" not allowed in import path

LGTM=ruiu, rsc
R=rsc, ruiu
CC=golang-codereviews
https://golang.org/cl/97630046

10 years agomisc: properly spell Chrome in doc
Dmitriy Vyukov [Mon, 26 May 2014 15:20:45 +0000 (19:20 +0400)]
misc: properly spell Chrome in doc

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/99440046

10 years agoruntime: skip stack growth test on 32bit platforms
Dave Cheney [Sat, 24 May 2014 22:38:59 +0000 (08:38 +1000)]
runtime: skip stack growth test on 32bit platforms

Update #8083

See discussion in https://groups.google.com/forum/#!topic/golang-dev/dh6Ra_xJomc

LGTM=khr
R=golang-codereviews, gobot, khr
CC=golang-codereviews
https://golang.org/cl/99440048

10 years agodoc: mention that reflect.SetMapIndex no longer panics
Keith Randall [Sat, 24 May 2014 00:39:58 +0000 (17:39 -0700)]
doc: mention that reflect.SetMapIndex no longer panics
when deleting from a nil map.  See issue 8051.

LGTM=r
R=golang-codereviews, r, khr
CC=golang-codereviews
https://golang.org/cl/96540051

10 years agoos: document that Interrupt might not work on every os
Alex Brainman [Fri, 23 May 2014 02:29:29 +0000 (12:29 +1000)]
os: document that Interrupt might not work on every os

Fixes #6720.

LGTM=bradfitz
R=golang-codereviews, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/92340043

10 years agospec: explicitly disallow blank methods in interface types
Robert Griesemer [Thu, 22 May 2014 19:23:25 +0000 (12:23 -0700)]
spec: explicitly disallow blank methods in interface types

The spec was unclear about whether blank methods should be
permitted in interface types. gccgo permits at most one, gc
crashes if there are more than one, go/types permits at most
one.

Discussion:

Since method sets of non-interface types never contain methods
with blank names (blank methods are never declared), it is impossible
to satisfy an interface with a blank method.

It is possible to declare variables of assignable interface types
(but not necessarily identical types) containing blank methods, and
assign those variables to each other, but the values of those
variables can only be nil.

There appear to be two "reasonable" alternatives:

1) Permit at most one blank method (since method names must be unique),
and consider it part of the interface. This is what appears to happen
now, with corner-case bugs. Such interfaces can never be implemented.

2) Permit arbitrary many blank methods but ignore them. This appears
to be closer to the handling of blank identifiers in declarations.
However, an interface type literal is not a declaration (it's a type
literal). Also, for struct types, blank identifiers are not ignored;
so the analogy with declarations is flawed.

Both these alternatives don't seem to add any benefit and are likely
(if only slightly) more complicated to explain and implement than
disallowing blank methods in interfaces altogether.

Fixes #6604.

LGTM=r, rsc, iant
R=r, rsc, ken, iant
CC=golang-codereviews
https://golang.org/cl/99410046

10 years agodoc/go1.3.html: change uintptr to integer in unsafe.Pointer section
Russ Cox [Thu, 22 May 2014 15:45:03 +0000 (11:45 -0400)]
doc/go1.3.html: change uintptr to integer in unsafe.Pointer section

The key property here is what the bit pattern represents,
not what its type is. Storing 5 into a pointer is the problem.
Storing a uintptr that holds pointer bits back into a pointer
is not as much of a problem, and not what we are claiming
the runtime will detect.

Longer discussion at
https://groups.google.com/d/msg/golang-nuts/dIGISmr9hw0/0jO4ce85Eh0J

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/98370045

10 years agocmd/cgo: explicitly state that #cgo directives across multiple files are concatenated
Pietro Gagliardi [Wed, 21 May 2014 23:01:54 +0000 (16:01 -0700)]
cmd/cgo: explicitly state that #cgo directives across multiple files are concatenated

This is a quick documentation change/clarification, as this
confused me before: in my own cgo-based projects, I currently have
identical #cgo directives in each relevant source file, and I notice
with go build -x that cgo is combining the directives, leading to
pkg-config invocations with the same package name (gtk+-3.0, in my
case) repeated several times, or on Mac OS X, LDFLAGS listing
-framework Foundation -framework AppKit multiple times. Since I am
about to add a CFLAGS as well, I checked the source to cmd/cgo and
go/build (where the work is actually done) to see if that still holds
true there. Hopefully other people who have made the same mistake I
have (I don't know if anyone has) can remove the excess declarations
now; this should make things slightly easier to manage as well.

LGTM=iant
R=golang-codereviews, gobot, iant
CC=golang-codereviews
https://golang.org/cl/91520046

10 years agoA+C: Pietro Gagliardi (individual CLA)
Ian Lance Taylor [Wed, 21 May 2014 23:01:41 +0000 (16:01 -0700)]
A+C: Pietro Gagliardi (individual CLA)

Generated by addca.

R=gobot
CC=golang-codereviews
https://golang.org/cl/97660043

10 years agodoc: fix typo in sharemem codewalk
Emil Hessman [Wed, 21 May 2014 21:34:20 +0000 (14:34 -0700)]
doc: fix typo in sharemem codewalk

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/98460045

10 years agoruntime: provide gc maps for the reflect.callXX frames.
Keith Randall [Wed, 21 May 2014 21:28:34 +0000 (14:28 -0700)]
runtime: provide gc maps for the reflect.callXX frames.

Update #8030

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/100620045

10 years agocmd/objdump: fix dissasembly of Plan 9 object files
Anthony Martin [Wed, 21 May 2014 21:24:38 +0000 (23:24 +0200)]
cmd/objdump: fix dissasembly of Plan 9 object files

Ignore symbols that aren't text, data, or bss since they cause
problems when dissassembling instructions with small immediate
values.

Before:
        build.go:142    0x10ee  83ec50      SUBL $text/template/parse.autotmp_1293(SB), SP

After:
        build.go:142    0x10ee  83ec50      SUBL $0x50, SP

Fixes #7947.

LGTM=rsc
R=rsc, 0intro
CC=golang-codereviews
https://golang.org/cl/93520045

10 years agotest: fix two typos in float_lit2.go
Russ Cox [Wed, 21 May 2014 21:19:12 +0000 (17:19 -0400)]
test: fix two typos in float_lit2.go

Noted by gri in CL 100660044 review but I missed them.

TBR=gri
CC=golang-codereviews
https://golang.org/cl/97570049

10 years agotest/float_lit2.go: rewrite to test values near boundaries
Russ Cox [Wed, 21 May 2014 21:12:06 +0000 (17:12 -0400)]
test/float_lit2.go: rewrite to test values near boundaries

Add larger comment explaining testing methodology,
and derive tests arithmetically.

(These tests are checking rounding again; the derived
tests they replace were checking exact values.)

LGTM=r, gri
R=gri, r
CC=golang-codereviews
https://golang.org/cl/100660044

10 years agocmd/gc: fix floating point rounding again
Russ Cox [Wed, 21 May 2014 21:11:52 +0000 (17:11 -0400)]
cmd/gc: fix floating point rounding again

Passes the expanded test in CL 100660044,
which gives me some confidence that it
might be right.

(The old code failed by not considering all the
low bits.)

LGTM=r
R=golang-codereviews, r, bradfitz
CC=golang-codereviews, iant, khr
https://golang.org/cl/99410051

10 years agofmt: fix floating-point padding once and for all
Rob Pike [Wed, 21 May 2014 19:30:43 +0000 (12:30 -0700)]
fmt: fix floating-point padding once and for all
Rewrite formatFloat to be much simpler and clearer and
avoid the tricky interaction with padding.
The issue refers to complex but the problem is just floating-point.
The new tests added were incorrectly formatted before this fix.
Fixes #8064.

LGTM=jscrockett01, rsc
R=rsc, jscrockett01
CC=golang-codereviews
https://golang.org/cl/99420048

10 years agocmd/go: fix coverage for 'package foo_test' tests
Russ Cox [Wed, 21 May 2014 17:59:14 +0000 (13:59 -0400)]
cmd/go: fix coverage for 'package foo_test' tests

Fixes #8062.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/91610046

10 years agocmd/go: check for SWIG version that is too old to use
Ian Lance Taylor [Wed, 21 May 2014 17:39:23 +0000 (10:39 -0700)]
cmd/go: check for SWIG version that is too old to use

Fixes #7983.

LGTM=crawshaw
R=golang-codereviews, crawshaw
CC=golang-codereviews, rsc
https://golang.org/cl/96540044

10 years agotest/float_lit2.go: fix constants for 386 platforms (fix build)
Robert Griesemer [Wed, 21 May 2014 16:15:07 +0000 (09:15 -0700)]
test/float_lit2.go: fix constants for 386 platforms (fix build)

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/95480045

10 years agotest/float_lit2.go: compute test values from first principles
Robert Griesemer [Wed, 21 May 2014 15:53:47 +0000 (08:53 -0700)]
test/float_lit2.go: compute test values from first principles

These constants pass go/types constant conversions as well.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/91590047