]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years ago[dev.power64] liblink: fix Solaris build
Austin Clements [Fri, 14 Nov 2014 20:53:15 +0000 (15:53 -0500)]
[dev.power64] liblink: fix Solaris build

a->class is a char.  Boo hoo.

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

10 years ago[dev.power64] 6g,9g: formatters for Prog and Addr details
Austin Clements [Fri, 14 Nov 2014 18:58:31 +0000 (13:58 -0500)]
[dev.power64] 6g,9g: formatters for Prog and Addr details

The pretty printers for these make it hard to understand
what's actually in the fields of these structures.  These
"ugly printers" show exactly what's in each field, which can
be useful for understanding and debugging code.

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

10 years ago[dev.power64] liblink: generate dnames[5689] for D_* constants
Austin Clements [Fri, 14 Nov 2014 17:08:46 +0000 (12:08 -0500)]
[dev.power64] liblink: generate dnames[5689] for D_* constants

This is more complicated than the other enums because the D_*
enums are full of explicit initializers and repeated values.
This tries its best.  (This will get much cleaner once we
tease these constants apart better.)

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

10 years ago[dev.power64] 5g,6g,8g,9g: debug prints for regopt pass 6 and paint2
Austin Clements [Fri, 14 Nov 2014 16:56:31 +0000 (11:56 -0500)]
[dev.power64] 5g,6g,8g,9g: debug prints for regopt pass 6 and paint2

Theses were very helpful in understanding the regions and
register selection when porting regopt to 9g.  Add them to the
other compilers (and improve 9g's successor debug print).

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

10 years ago[dev.power64] 5g,6g,8g: synchronize documentation for regopt structures
Austin Clements [Fri, 14 Nov 2014 16:07:33 +0000 (11:07 -0500)]
[dev.power64] 5g,6g,8g: synchronize documentation for regopt structures

I added several comments to the regopt-related structures when
porting it to 9g.  Synchronize those comments back in to the
other compilers.

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

10 years ago[dev.power64] 9g: implement regopt
Austin Clements [Thu, 13 Nov 2014 18:51:44 +0000 (13:51 -0500)]
[dev.power64] 9g: implement regopt

This adds registerization support to 9g equivalent to what the
other compilers have.

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

10 years ago[dev.power64] 9l: remove enum as's tag for c2go
Austin Clements [Thu, 13 Nov 2014 18:48:59 +0000 (13:48 -0500)]
[dev.power64] 9l: remove enum as's tag for c2go

None of the other compilers have a tag for this enum.
Cleaning all of this up to use proper types will happen after
the conversion.

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

10 years ago[dev.power64] 6g,8g: remove unnecessary and incorrect reg use scanning
Austin Clements [Thu, 13 Nov 2014 18:34:20 +0000 (13:34 -0500)]
[dev.power64] 6g,8g: remove unnecessary and incorrect reg use scanning

Previously, the 6g and 8g registerizers scanned for used
registers beyond the end of a region being considered for
registerization.  This ancient artifact was copied from the C
compilers, where it was probably necessary to track implicitly
used registers.  In the Go compilers it's harmless (because it
can only over-restrict the set of available registers), but no
longer necessary because the Go compilers correctly track
register use/set information.  The consequences of this extra
scan were (at least) that 1) we would not consider allocating
the AX register if there was a deferproc call in the future
because deferproc uses AX as a return register, so we see the
use of AX, but don't track that AX is set by the CALL, and 2)
we could not consider allocating the DX register if there was
a MUL in the future because MUL implicitly sets DX and (thanks
to an abuse of copyu in this code) we would also consider DX
used.

This commit fixes these problems by nuking this code.

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

10 years ago[dev.power64] liblink: improve documentation of struct Prog
Austin Clements [Wed, 12 Nov 2014 22:19:02 +0000 (17:19 -0500)]
[dev.power64] liblink: improve documentation of struct Prog

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

10 years ago[dev.power64] 9g: proginfo fixes
Austin Clements [Wed, 12 Nov 2014 19:58:43 +0000 (14:58 -0500)]
[dev.power64] 9g: proginfo fixes

For D_OREG addresses, store the used registers in regindex
instead of reguse because they're really part of addressing.

Add implicit register use/set for DUFFZERO/DUFFCOPY.

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

10 years ago[dev.power64] 9g: fix width check and width calculation for OADDR
Austin Clements [Wed, 12 Nov 2014 19:16:49 +0000 (14:16 -0500)]
[dev.power64] 9g: fix width check and width calculation for OADDR

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

10 years ago[dev.power64] 5g: fix mistaken bit-wise AND in regopt
Austin Clements [Fri, 7 Nov 2014 15:43:55 +0000 (10:43 -0500)]
[dev.power64] 5g: fix mistaken bit-wise AND in regopt

Replace a bit-wise AND with a logical one.  This happened to
work before because bany returns 0 or 1, but the intent here
is clearly logical (and this makes 5g match with 6g and 8g).

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

10 years ago[dev.power64] 5g: fix etype and width of itable Addrs
Austin Clements [Thu, 6 Nov 2014 20:35:53 +0000 (15:35 -0500)]
[dev.power64] 5g: fix etype and width of itable Addrs

For OITAB nodes, 5g's naddr was setting the wrong etype and
failing to set the width of the resulting Addr.

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

10 years ago[dev.power64] 9g: fix addr width calculation; enable MOV* width check
Austin Clements [Thu, 6 Nov 2014 19:41:44 +0000 (14:41 -0500)]
[dev.power64] 9g: fix addr width calculation; enable MOV* width check

9g's naddr was missing assignments to a->width in several
cases, so the optimizer was getting bogus width information.
Add them.

This correct width information also lets us enable the width
check in gins for MOV*.

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

10 years ago[dev.power64] gc: fix etype of strings
Austin Clements [Thu, 6 Nov 2014 19:37:39 +0000 (14:37 -0500)]
[dev.power64] gc: fix etype of strings

The etype of references to strings was being incorrectly set
to TINT32 on all platforms.  Change it to TSTRING.  It seems
this doesn't matter for compilation, since x86 uses LEA
instructions to load string addresses and arm and power64
disassemble the string into its constituent pieces (with the
correct types), but it helps when debugging.

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

10 years ago[dev.power64] 6g: don't create variables for indirect addresses
Austin Clements [Wed, 5 Nov 2014 20:36:47 +0000 (15:36 -0500)]
[dev.power64] 6g: don't create variables for indirect addresses

Previously, mkvar treated, for example, 0(AX) the same as AX.
As a result, a move to an indirect address would be marked as
*setting* the register, rather than just using it, resulting
in unnecessary register moves.  Fix this by not producing
variables for indirect addresses.

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

10 years ago[dev.power64] gc: convert Bits to a uint64 array
Austin Clements [Tue, 4 Nov 2014 21:34:56 +0000 (16:34 -0500)]
[dev.power64] gc: convert Bits to a uint64 array

So far all of our architectures have had at most 32 registers,
so we've been able to use entry 0 in the Bits uint32 array
directly as a register mask.  Power64 has 64 registers, so
this converts Bits to a uint64 array so we can continue to use
entry 0 directly as a register mask on Power64.

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

10 years ago[dev.power64] test: "fix" live.go test on power64x
Austin Clements [Mon, 3 Nov 2014 22:25:36 +0000 (17:25 -0500)]
[dev.power64] test: "fix" live.go test on power64x

On power64x, this one line in live.go reports that t is live
because of missing optimization passes.  This isn't what this
test is trying to test, so shuffle bad40 so that it still
accomplishes the intent of the test without also depending on
optimization.

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

10 years ago[dev.power64] test: disable nilptr3 test on power64x
Austin Clements [Mon, 3 Nov 2014 22:25:03 +0000 (17:25 -0500)]
[dev.power64] test: disable nilptr3 test on power64x

The remaining failures in this test are because of incomplete
optimization support on power64x.  Tracked in issue 9058.

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

10 years ago[dev.power64] liblink: fix printing of branch targets
Austin Clements [Mon, 3 Nov 2014 22:24:13 +0000 (17:24 -0500)]
[dev.power64] liblink: fix printing of branch targets

Print PC stored in target Prog* of branch instructions when
available instead of the offset stored in the branch
instruction.  The offset tends to be wrong after code
transformations, so previously this led to confusing listings.

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

10 years ago[dev.power64] 9g: fix nilopt
Austin Clements [Mon, 3 Nov 2014 20:48:51 +0000 (15:48 -0500)]
[dev.power64] 9g: fix nilopt

Previously, nilopt was disabled on power64x because it threw
away "seemly random segments of code."  Indeed, excise on
power64x failed to preserve the link field, so it excised not
only the requested instruction but all following instructions
in the function.  Fix excise to retain the link field while
otherwise zeroing the instruction.

This makes nilopt safe on power64x.  It still fails
nilptr3.go's tests for removal of repeated nil checks because
those depend on also optimizing away repeated loads, which
doesn't currently happen on power64x.

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

10 years ago[dev.power64] all: merge default into dev.power64
Austin Clements [Mon, 3 Nov 2014 15:53:11 +0000 (10:53 -0500)]
[dev.power64] all: merge default into dev.power64

Trivial merge except for src/runtime/asm_power64x.s and
src/runtime/signal_power64x.c

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

10 years agodoc: document go get -f flag in 1.4 release notes
Andrew Gerrand [Mon, 3 Nov 2014 06:01:17 +0000 (17:01 +1100)]
doc: document go get -f flag in 1.4 release notes

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

10 years ago[dev.power64] cmd/objdump: disable tests on power64/power64le
Dave Cheney [Sun, 2 Nov 2014 00:23:41 +0000 (11:23 +1100)]
[dev.power64] cmd/objdump: disable tests on power64/power64le

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

10 years agomisc: Increase issue 6997's test timeout to prevent spurious failures.
Benoit Sigoure [Sat, 1 Nov 2014 15:28:09 +0000 (08:28 -0700)]
misc: Increase issue 6997's test timeout to prevent spurious failures.

On heavily loaded build servers, a 5 second timeout is too aggressive,
which causes this test to fail spuriously.

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

10 years agoA+C: add Benoit Sigoure (individual CLA)
Ian Lance Taylor [Sat, 1 Nov 2014 15:27:55 +0000 (08:27 -0700)]
A+C: add Benoit Sigoure (individual CLA)

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

10 years ago[dev.power64] runtime: fix gcinfo_test on power64x
Austin Clements [Fri, 31 Oct 2014 20:58:12 +0000 (16:58 -0400)]
[dev.power64] runtime: fix gcinfo_test on power64x

The GC info masks for slices and strings were changed in
commit caab29a25f68, but the reference masks used by
gcinfo_test for power64x hadn't caught up.  Now they're
identical to amd64, so this CL fixes this test by combining
the reference masks for these platforms.

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

10 years ago[dev.power64] reflect: fix asm on power64x
Austin Clements [Fri, 31 Oct 2014 19:29:03 +0000 (15:29 -0400)]
[dev.power64] reflect: fix asm on power64x

reflect/asm_power64x.s was missing changes made to other
platforms for stack maps.  This CL ports those changes.  With
this fix, the reflect test passes on power64x.

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

10 years ago[dev.power64] runtime: fix fastrand1 on power64x
Austin Clements [Fri, 31 Oct 2014 17:39:36 +0000 (13:39 -0400)]
[dev.power64] runtime: fix fastrand1 on power64x

fastrand1 depends on testing the high bit of its uint32 state.
For efficiency, all of the architectures implement this as a
sign bit test.  However, on power64, fastrand1 was using a
64-bit sign test on the zero-extended 32-bit state.  This
always failed, causing fastrand1 to have very short periods
and often decay to 0 and get stuck.

Fix this by using a 32-bit signed compare instead of a 64-bit
compare.  This fixes various tests for the randomization of
select of map iteration.

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

10 years agonet/http: add missing newline in list of leaked goroutines
Ian Lance Taylor [Fri, 31 Oct 2014 17:20:36 +0000 (10:20 -0700)]
net/http: add missing newline in list of leaked goroutines

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

10 years agodatabase/sql: make TestDrivers not crash on second run
Brad Fitzpatrick [Fri, 31 Oct 2014 16:49:42 +0000 (09:49 -0700)]
database/sql: make TestDrivers not crash on second run

Using -test.cpu=1,1 made it crash before.

Fixes #9024

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

10 years agocmd/go: fixed typo in doc and generator
Gabriel Aszalos [Fri, 31 Oct 2014 16:38:41 +0000 (09:38 -0700)]
cmd/go: fixed typo in doc and generator

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

10 years agoA+C: add Gabriel Aszalos (individual CLA)
Ian Lance Taylor [Fri, 31 Oct 2014 16:37:11 +0000 (09:37 -0700)]
A+C: add Gabriel Aszalos (individual CLA)

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

10 years ago[dev.power64] 9g: fix under-zeroing in clearfat
Austin Clements [Fri, 31 Oct 2014 15:08:27 +0000 (11:08 -0400)]
[dev.power64] 9g: fix under-zeroing in clearfat

All three cases of clearfat were wrong on power64x.

The cases that handle 1032 bytes and up and 32 bytes and up
both use MOVDU (one directly generated in a loop and the other
via duffzero), which leaves the pointer register pointing at
the *last written* address.  The generated code was not
accounting for this, so the byte fill loop was re-zeroing the
last zeroed dword, rather than the bytes following the last
zeroed dword.  Fix this by simply adding an additional 8 byte
offset to the byte zeroing loop.

The case that handled under 32 bytes was also wrong.  It
didn't update the pointer register at all, so the byte zeroing
loop was simply re-zeroing the beginning of region.  Again,
the fix is to add an offset to the byte zeroing loop to
account for this.

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

10 years agosync/atomic: fix comment referencing Value.Store's argument name
Brad Fitzpatrick [Fri, 31 Oct 2014 03:48:57 +0000 (00:48 -0300)]
sync/atomic: fix comment referencing Value.Store's argument name

Fixes #9029

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

10 years ago[dev.power64] runtime: fix a syntax error that slipped in to asm_power64x.s
Austin Clements [Thu, 30 Oct 2014 20:44:42 +0000 (16:44 -0400)]
[dev.power64] runtime: fix a syntax error that slipped in to asm_power64x.s

Apparently I had already moved on to fixing another problem
when I submitted CL 169790043.

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

10 years agocmd/go: fix minor typo
Nathan P Finch [Thu, 30 Oct 2014 20:20:43 +0000 (13:20 -0700)]
cmd/go: fix minor typo

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

10 years agoA+C: Nathan P Finch (individual CLA)
Brad Fitzpatrick [Thu, 30 Oct 2014 20:19:29 +0000 (17:19 -0300)]
A+C: Nathan P Finch (individual CLA)

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

10 years agoA+C: add Jed Denlea (Fastly corporate CLA)
Brad Fitzpatrick [Thu, 30 Oct 2014 20:15:43 +0000 (13:15 -0700)]
A+C: add Jed Denlea (Fastly corporate CLA)

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

10 years ago[dev.power64] runtime: make asm_power64x.s go vet-clean
Austin Clements [Thu, 30 Oct 2014 19:58:30 +0000 (15:58 -0400)]
[dev.power64] runtime: make asm_power64x.s go vet-clean

No real problems found.  Just lots of argument names that
didn't quite match up.

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

10 years agomisc/cgo/test: fix bad C test code that fails on some configurations
Alan Donovan [Thu, 30 Oct 2014 18:08:55 +0000 (14:08 -0400)]
misc/cgo/test: fix bad C test code that fails on some configurations

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

10 years agocmd/cgo: avoid worklist nondeterminism.
Alan Donovan [Thu, 30 Oct 2014 18:01:14 +0000 (14:01 -0400)]
cmd/cgo: avoid worklist nondeterminism.

+ Regression test.

Fixes #9026.

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

10 years ago[dev.power64] runtime: fix out-of-date comment in panic
Austin Clements [Thu, 30 Oct 2014 16:08:21 +0000 (12:08 -0400)]
[dev.power64] runtime: fix out-of-date comment in panic

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

10 years ago[dev.power64] runtime: test CAS on large unsigned 32-bit numbers
Austin Clements [Thu, 30 Oct 2014 15:17:26 +0000 (11:17 -0400)]
[dev.power64] runtime: test CAS on large unsigned 32-bit numbers

This adds a test to runtime·check to ensure CAS of large
unsigned 32-bit numbers does not accidentally sign-extend its
arguments.

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

10 years ago[dev.power64] runtime: match argument/return type signedness in power64x assembly
Austin Clements [Thu, 30 Oct 2014 14:45:41 +0000 (10:45 -0400)]
[dev.power64] runtime: match argument/return type signedness in power64x assembly

Previously, the power64x runtime assembly was sloppy about
using sign-extending versus zero-extending moves of arguments
and return values.  I think all of the cases that actually
mattered have been fixed in recent CLs; this CL fixes up the
few remaining mismatches.

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

10 years agodoc/go1.4.html: tweak http.Transport.DialTLS wording
Brad Fitzpatrick [Thu, 30 Oct 2014 13:58:31 +0000 (10:58 -0300)]
doc/go1.4.html: tweak http.Transport.DialTLS wording

It doesn't simplify, because it wasn't even possible before.

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

10 years agodoc/go1.4.html: fix typo
Mikio Hara [Thu, 30 Oct 2014 05:15:00 +0000 (14:15 +0900)]
doc/go1.4.html: fix typo

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

10 years agotag go1.4beta1
Andrew Gerrand [Thu, 30 Oct 2014 01:33:57 +0000 (12:33 +1100)]
tag go1.4beta1

TBR=rsc
R=r, rsc
CC=golang-codereviews
https://golang.org/cl/164240043

10 years agocmd/objdump: disable test failing on arm5 go1.4beta1
Russ Cox [Thu, 30 Oct 2014 01:02:58 +0000 (21:02 -0400)]
cmd/objdump: disable test failing on arm5

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

10 years agoruntime: change top-most return PC from goexit to goexit+PCQuantum
Russ Cox [Thu, 30 Oct 2014 00:37:44 +0000 (20:37 -0400)]
runtime: change top-most return PC from goexit to goexit+PCQuantum

If you get a stack of PCs from Callers, it would be expected
that every PC is immediately after a call instruction, so to find
the line of the call, you look up the line for PC-1.
CL 163550043 now explicitly documents that.

The most common exception to this is the top-most return PC
on the stack, which is the entry address of the runtime.goexit
function. Subtracting 1 from that PC will end up in a different
function entirely.

To remove this special case, make the top-most return PC
goexit+PCQuantum and then implement goexit in assembly
so that the first instruction can be skipped.

Fixes #7690.

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

10 years agoruntime: make TestCgoExternalThreadPanic run on windows
Alex Brainman [Wed, 29 Oct 2014 23:24:37 +0000 (10:24 +1100)]
runtime: make TestCgoExternalThreadPanic run on windows

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

10 years agodoc/go1.4.html: final library changes
Rob Pike [Wed, 29 Oct 2014 22:35:48 +0000 (15:35 -0700)]
doc/go1.4.html: final library changes
First draft now complete.

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

10 years agocmd/objdump: use cmd/internal/objfile
Russ Cox [Wed, 29 Oct 2014 22:07:24 +0000 (18:07 -0400)]
cmd/objdump: use cmd/internal/objfile

This removes a bunch of ugly duplicate code.
The end goal is to factor the disassembly code
into cmd/internal/objfile too, so that pprof can use it,
but one step at a time.

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

10 years agodoc/go1.4.html: gccgo status
Rob Pike [Wed, 29 Oct 2014 20:07:34 +0000 (13:07 -0700)]
doc/go1.4.html: gccgo status

LGTM=iant, cmang
R=cmang, iant, rsc
CC=golang-codereviews
https://golang.org/cl/169760043

10 years agoruntime: fix line number in first stack frame in printed stack trace
Russ Cox [Wed, 29 Oct 2014 19:14:24 +0000 (15:14 -0400)]
runtime: fix line number in first stack frame in printed stack trace

Originally traceback was only used for printing the stack
when an unexpected signal came in. In that case, the
initial PC is taken from the signal and should be used
unaltered. For the callers, the PC is the return address,
which might be on the line after the call; we subtract 1
to get to the CALL instruction.

Traceback is now used for a variety of things, and for
almost all of those the initial PC is a return address,
whether from getcallerpc, or gp->sched.pc, or gp->syscallpc.
In those cases, we need to subtract 1 from this initial PC,
but the traceback code had a hard rule "never subtract 1
from the initial PC", left over from the signal handling days.

Change gentraceback to take a flag that specifies whether
we are tracing a trap.

Change traceback to default to "starting with a return PC",
which is the overwhelmingly common case.

Add tracebacktrap, like traceback but starting with a trap PC.

Use tracebacktrap in signal handlers.

Fixes #7690.

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

10 years agoruntime: update comment for Callers
Russ Cox [Wed, 29 Oct 2014 19:14:04 +0000 (15:14 -0400)]
runtime: update comment for Callers

Attempt to clear up confusion about how to turn
the PCs reported by Callers into the file and line
number people actually want.

Fixes #7690.

LGTM=r, chris.cs.guy
R=r, chris.cs.guy
CC=golang-codereviews
https://golang.org/cl/163550043

10 years ago[dev.power64] all: merge default (dd5014ed9b01) into dev.power64
Russ Cox [Wed, 29 Oct 2014 15:45:01 +0000 (11:45 -0400)]
[dev.power64] all: merge default (dd5014ed9b01) into dev.power64

Still passes on amd64.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/165110043

10 years agodoc/go1.4.html: half of the small library changes
Rob Pike [Wed, 29 Oct 2014 15:15:58 +0000 (08:15 -0700)]
doc/go1.4.html: half of the small library changes

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

10 years agofmt: fix one-letter typo in doc.go
Rob Pike [Wed, 29 Oct 2014 13:53:05 +0000 (06:53 -0700)]
fmt: fix one-letter typo in doc.go
Stupid mistake in previous CL.

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

10 years agocmd/objdump: skip extld test on plan9
Russ Cox [Wed, 29 Oct 2014 04:03:17 +0000 (00:03 -0400)]
cmd/objdump: skip extld test on plan9

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

10 years agoruntime: fix windows build
Russ Cox [Wed, 29 Oct 2014 04:02:29 +0000 (00:02 -0400)]
runtime: fix windows build

TBR=austin
CC=golang-codereviews
https://golang.org/cl/167820043

10 years agocmd/gc: fix build - remove unused variables in walkprint
Russ Cox [Wed, 29 Oct 2014 03:45:01 +0000 (23:45 -0400)]
cmd/gc: fix build - remove unused variables in walkprint

TBR=austin
CC=golang-codereviews
https://golang.org/cl/162420043

10 years agocmd/objdump: disassemble local text symbols
Ian Lance Taylor [Wed, 29 Oct 2014 03:25:55 +0000 (23:25 -0400)]
cmd/objdump: disassemble local text symbols

Fixes #8803.

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

10 years agocmd/gc: fix internal compiler error in struct compare
Russ Cox [Wed, 29 Oct 2014 03:22:46 +0000 (23:22 -0400)]
cmd/gc: fix internal compiler error in struct compare

Fixes #9006.

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

10 years agofmt: fix documentation for %g and %G
Rob Pike [Wed, 29 Oct 2014 03:19:03 +0000 (20:19 -0700)]
fmt: fix documentation for %g and %G
It now echoes what strconv.FormatFloat says.

Fixes #9012.

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

10 years agodoc/go1.4.html: GODEBUG and assembler changes
Rob Pike [Wed, 29 Oct 2014 03:12:17 +0000 (20:12 -0700)]
doc/go1.4.html: GODEBUG and assembler changes

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

10 years agoruntime: add GODEBUG invalidptr setting
Russ Cox [Wed, 29 Oct 2014 01:53:31 +0000 (21:53 -0400)]
runtime: add GODEBUG invalidptr setting

Fixes #8861.
Fixes #8911.

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

10 years agoruntime: fix unrecovered panic on external thread
Russ Cox [Wed, 29 Oct 2014 01:53:09 +0000 (21:53 -0400)]
runtime: fix unrecovered panic on external thread

Fixes #8588.

LGTM=austin
R=austin
CC=golang-codereviews, khr
https://golang.org/cl/159700044

10 years agocmd/gc: avoid use of goprintf
Russ Cox [Wed, 29 Oct 2014 01:52:53 +0000 (21:52 -0400)]
cmd/gc: avoid use of goprintf

goprintf is a printf-like print for Go.
It is used in the code generated by 'defer print(...)' and 'go print(...)'.

Normally print(1, 2, 3) turns into

        printint(1)
        printint(2)
        printint(3)

but defer and go need a single function call to give the runtime;
they give the runtime something like goprintf("%d%d%d", 1, 2, 3).

Variadic functions like goprintf cannot be described in the new
type information world, so we have to replace it.

Replace with a custom function, so that defer print(1, 2, 3) turns
into

        defer func(a1, a2, a3 int) {
                print(a1, a2, a3)
        }(1, 2, 3)

(and then the print becomes three different printints as usual).

Fixes #8614.

LGTM=austin
R=austin
CC=golang-codereviews, r
https://golang.org/cl/159700043

10 years ago[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped
Russ Cox [Wed, 29 Oct 2014 01:50:16 +0000 (21:50 -0400)]
[dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped

I removed support for jumping between functions years ago,
as part of doing the instruction layout for each function separately.

Given that, it makes sense to treat labels as function-scoped.
This lets each function have its own 'loop' label, for example.

Makes the assembly much cleaner and removes the last
reason anyone would reach for the 123(PC) form instead.

Note that this is on the dev.power64 branch, but it changes all
the assemblers. The change will ship in Go 1.5 (perhaps after
being ported into the new assembler).

Came up as part of CL 167730043.

LGTM=r
R=r
CC=austin, dave, golang-codereviews, minux
https://golang.org/cl/159670043

10 years agoos: fix write on Plan 9
David du Colombier [Tue, 28 Oct 2014 21:44:59 +0000 (22:44 +0100)]
os: fix write on Plan 9

In CL 160670043 the write function was changed
so a zero-length write is now allowed. This leads
the ExampleWriter_Init test to fail.

The reason is that Plan 9 preserves message
boundaries, while the os library expects systems
that don't preserve them. We have to ignore
zero-length writes so they will never turn into EOF.

This issue was previously discussed in CL 7406046.

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

10 years agodoc/go1.4.html: breaking compiler change, no plugins in misc
Rob Pike [Tue, 28 Oct 2014 20:49:41 +0000 (13:49 -0700)]
doc/go1.4.html: breaking compiler change, no plugins in misc

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

10 years ago[dev.power64] runtime: fix atomicor8 for power64x
Austin Clements [Tue, 28 Oct 2014 19:57:33 +0000 (15:57 -0400)]
[dev.power64] runtime: fix atomicor8 for power64x

Power64 servers do not currently support sub-word size atomic
memory access, so atomicor8 uses word size atomic access.
However, previously atomicor8 made no attempt to align this
access, resulting in errors.  Fix this by aligning the pointer
to a word boundary and shifting the value appropriately.
Since atomicor8 is used in GC, add a test to runtime·check to
make sure this doesn't break in the future.

This also fixes an incorrect branch label, an incorrectly
sized argument move, and adds argument names to help go vet.

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

10 years agodoc/asm: explain coordination with garbage collector
Russ Cox [Tue, 28 Oct 2014 19:51:06 +0000 (15:51 -0400)]
doc/asm: explain coordination with garbage collector

Also a few other minor changes.

Fixes #8712.

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

10 years agoos: fix build
Russ Cox [Tue, 28 Oct 2014 19:34:50 +0000 (15:34 -0400)]
os: fix build

TBR=crawshaw
CC=golang-codereviews
https://golang.org/cl/162390043

10 years agodoc/go1.4.html: new ports
Rob Pike [Tue, 28 Oct 2014 19:11:34 +0000 (12:11 -0700)]
doc/go1.4.html: new ports

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

10 years ago[dev.power64] 9a: correct generation of four argument ops
Austin Clements [Tue, 28 Oct 2014 19:08:09 +0000 (15:08 -0400)]
[dev.power64] 9a: correct generation of four argument ops

The "to" field was the penultimate argument to outgcode,
instead of the last argument, which swapped the third and
fourth operands.  The argument order was correct in a.y, so
just swap the meaning of the arguments in outgcode.  This
hadn't come up because we hadn't used these more obscure
operations in any hand-written assembly until now.

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

10 years agoos: do not assume syscall i/o funcs return n=0 on error
Russ Cox [Tue, 28 Oct 2014 19:00:13 +0000 (15:00 -0400)]
os: do not assume syscall i/o funcs return n=0 on error

Fixes #9007.

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

10 years agodoc/go1.4.html: vanity imports and internal packages
Rob Pike [Tue, 28 Oct 2014 17:51:28 +0000 (10:51 -0700)]
doc/go1.4.html: vanity imports and internal packages

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

10 years agoruntime: add PauseEnd array to MemStats and GCStats
Jens Frederich [Tue, 28 Oct 2014 16:35:25 +0000 (12:35 -0400)]
runtime: add PauseEnd array to MemStats and GCStats

Fixes #8787.

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

10 years agosyscall: fix ParseRoutingSockaddr with unexpected submessages
Russ Cox [Tue, 28 Oct 2014 15:35:00 +0000 (11:35 -0400)]
syscall: fix ParseRoutingSockaddr with unexpected submessages

No easy way to test (would have to actually trigger some routing
events from kernel) but the code is clearly wrong as written.
If the header says there is a submessage, we need to at least
skip over its bytes, not just continue to the next iteration.

Fixes #8203.

LGTM=r
R=r
CC=golang-codereviews, mikioh.mikioh, p
https://golang.org/cl/164140044

10 years agocmd/go: add get -f flag
Russ Cox [Tue, 28 Oct 2014 15:14:25 +0000 (11:14 -0400)]
cmd/go: add get -f flag

get -u now checks that remote repo paths match the
ones predicted by the import paths: if you are get -u'ing
rsc.io/pdf, it has to be checked out from the right location.
This is important in case the rsc.io/pdf redirect changes.

In some cases, people have good reasons to use
non-standard remote repos. Add -f flag to allow that.
The f can stand for force or fork, as you see fit.

Fixes #8850.

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

10 years ago[dev.power64] liblink: emit wrapper code in correct place
Austin Clements [Tue, 28 Oct 2014 14:14:19 +0000 (10:14 -0400)]
[dev.power64] liblink: emit wrapper code in correct place

The wrapper code was being emitted before the stack
reservation, rather than after.

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

10 years agonet: add test for lookupIPDeadline
Mikio Hara [Tue, 28 Oct 2014 07:20:49 +0000 (16:20 +0900)]
net: add test for lookupIPDeadline

Just to confirm the fix, by typing the follwing:
go test -run=TestLookupIPDeadline -dnsflood or
go test -run=TestLookupIPDeadline -dnsflood -tags netgo

Update #8602

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

10 years agodoc/go1.4.html: much of the go command's changes
Rob Pike [Tue, 28 Oct 2014 05:47:50 +0000 (22:47 -0700)]
doc/go1.4.html: much of the go command's changes
still need to do internal and import comments

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

10 years agodoc/go1.4.html: runtime and performance
Rob Pike [Tue, 28 Oct 2014 03:35:34 +0000 (20:35 -0700)]
doc/go1.4.html: runtime and performance

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

10 years agoruntime: disable fake time on nacl
Russ Cox [Tue, 28 Oct 2014 00:47:15 +0000 (20:47 -0400)]
runtime: disable fake time on nacl

This leaked into the CL I submitted for Minux,
because I was testing it.

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

10 years agosyscall: accept pre-existing directories in nacl zip file
Russ Cox [Tue, 28 Oct 2014 00:45:16 +0000 (20:45 -0400)]
syscall: accept pre-existing directories in nacl zip file

NaCl creates /tmp. This lets the zip file populate it.

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

10 years agoruntime: add fake time support back.
Shenghou Ma [Tue, 28 Oct 2014 00:35:15 +0000 (20:35 -0400)]
runtime: add fake time support back.
Revived from CL 15690048.

Fixes #5356.

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

10 years ago[dev.power64] runtime: fix cas64 on power64x
Dave Cheney [Tue, 28 Oct 2014 00:15:48 +0000 (11:15 +1100)]
[dev.power64] runtime: fix cas64 on power64x

cas64 was jumping to the wrong offset.

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

10 years agodoc/go_mem.html: don't be clever
Rob Pike [Tue, 28 Oct 2014 00:08:50 +0000 (17:08 -0700)]
doc/go_mem.html: don't be clever

Add a short introductory section saying what most Go
programmers really need to know, which is that you
shouldn't have to read this document to understand
the behavior of your program.

LGTM=bradfitz, adg, tracey.brendan, iant, rsc, dsymonds
R=golang-codereviews, bradfitz, tracey.brendan, adg, iant, rsc, dsymonds
CC=golang-codereviews
https://golang.org/cl/158500043

10 years agospec: permit parentheses around builtin function names
Robert Griesemer [Mon, 27 Oct 2014 23:31:15 +0000 (16:31 -0700)]
spec: permit parentheses around builtin function names

Not a language change.

This is simply documenting the status quo which permits
builtin function names to be parenthesized in calls; e.g.,
both

        len(s)
and
        (((len)))(s)

are accepted by all compilers and go/types.

Changed the grammar by merging the details of BuiltinCall
with ordinary Calls. Also renamed the Call production to
Arguments which more clearly identifies that part of the
grammar and also matches better with its counterpart on
the declaration side (Parameters).

The fact that the first argument can be a type (for builtins)
or cannot be a type (for regular function calls) is expressed
in the prose, no need to make the grammar more complicated.

Fixes #9001.

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

10 years agohtml/template: fix build after encoding/js escaping change
Andrew Gerrand [Mon, 27 Oct 2014 23:18:44 +0000 (10:18 +1100)]
html/template: fix build after encoding/js escaping change

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

10 years agotest: make maplinear more robust
Russ Cox [Mon, 27 Oct 2014 22:59:02 +0000 (18:59 -0400)]
test: make maplinear more robust

The test just doubled a certain number of times
and then gave up. On a mostly fast but occasionally
slow machine this may never make the test run
long enough to see the linear growth.

Change test to keep doubling until the first round
takes at least a full second, to reduce the effect of
occasional scheduling or other jitter.

The failure we saw had a time for the first round
of around 100ms.

Note that this test still passes once it sees a linear
effect, even with a very small total time.
The timeout here only applies to how long the execution
must be to support a reported failure.

LGTM=khr
R=khr
CC=golang-codereviews, rlh
https://golang.org/cl/164070043

10 years agoencoding/json: encode \t as \t instead of \u0009
Russ Cox [Mon, 27 Oct 2014 22:58:25 +0000 (18:58 -0400)]
encoding/json: encode \t as \t instead of \u0009

Shorter and easier to read form for a common character.

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

10 years ago[dev.power64] runtime: fix power64le build
Dave Cheney [Mon, 27 Oct 2014 22:56:33 +0000 (09:56 +1100)]
[dev.power64] runtime: fix power64le build

Brings defs_linux_power64le.h up to date with the big endian version.

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

10 years ago[dev.power64] runtime: power64 fixes and ports of changes
Austin Clements [Mon, 27 Oct 2014 21:27:03 +0000 (17:27 -0400)]
[dev.power64] runtime: power64 fixes and ports of changes

Fix include paths that got moved in the great pkg/ rename.  Add
missing runtime/arch_* files for power64.  Port changes that
happened on default since branching to
runtime/{asm,atomic,sys_linux}_power64x.s (precise stacks,
calling convention change, various new and deleted functions.
Port struct renaming and fix some bugs in
runtime/defs_linux_power64.h.

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

10 years agodoc/go1.4.html: first pieces of release notes
Rob Pike [Mon, 27 Oct 2014 21:23:24 +0000 (14:23 -0700)]
doc/go1.4.html: first pieces of release notes
Move the release notes into an HTML file.
Start writing the text.

LGTM=rsc
R=golang-codereviews, bradfitz, kamil.kisiel, tracey.brendan, rsc
CC=golang-codereviews
https://golang.org/cl/161350043

10 years ago[dev.power64] liblink: fix lost branch target
Austin Clements [Mon, 27 Oct 2014 21:19:41 +0000 (17:19 -0400)]
[dev.power64] liblink: fix lost branch target

A recent commit lost the branch target in the really-big-stack
case of splitstack, causing an infinite loop stack preempt
case.  Revive the branch target.

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

10 years ago[dev.power64] all: merge default into dev.power64
Austin Clements [Mon, 27 Oct 2014 21:17:06 +0000 (17:17 -0400)]
[dev.power64] all: merge default into dev.power64

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