]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
8 years ago[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch
Keith Randall [Tue, 14 Jun 2016 14:33:48 +0000 (07:33 -0700)]
[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Change-Id: Idd150294aaeced0176b53d6b95852f5d21ff4fdc

8 years agocrypto/x509: don't ignore asn1.Marshal error
Ian Lance Taylor [Tue, 7 Jun 2016 16:42:48 +0000 (09:42 -0700)]
crypto/x509: don't ignore asn1.Marshal error

I don't see how the call could fail, so, no test. Just a code cleanup in
case it can fail in the future.

Fixes #15987.

Change-Id: If4af0d5e7d19cc8b13fb6a4f7661c37fb0015e83
Reviewed-on: https://go-review.googlesource.com/23860
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
8 years agocmd/go: include .syso files even if CGO_ENABLED=0
Ian Lance Taylor [Mon, 13 Jun 2016 18:55:30 +0000 (11:55 -0700)]
cmd/go: include .syso files even if CGO_ENABLED=0

A .syso file may include information that should go into the object file
that is not object code, and should be included even if not using cgo.
The example in the issue is a Windows manifest file.

Fixes #16050.

Change-Id: I1f4f3f80bb007e84d153ca2d26e5919213ea4f8d
Reviewed-on: https://go-review.googlesource.com/24032
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
8 years agocmd/go: remove obsolete comment referring to deleted parameter
Ian Lance Taylor [Fri, 10 Jun 2016 17:41:36 +0000 (10:41 -0700)]
cmd/go: remove obsolete comment referring to deleted parameter

The dir parameter was removed in https://golang.org/cl/5732045.

Fixes #15503.

Change-Id: I02a6d8317233bea08633715a095ea2514822032b
Reviewed-on: https://go-review.googlesource.com/24011
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoos: fix build on freebsd/arm
Mikio Hara [Tue, 14 Jun 2016 01:14:28 +0000 (10:14 +0900)]
os: fix build on freebsd/arm

Change-Id: I21fad94ff94e342ada18e0e41ca90296d030115f
Reviewed-on: https://go-review.googlesource.com/24061
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoos: use wait6 to avoid wait/kill race on freebsd
Mikio Hara [Sat, 11 Jun 2016 10:55:34 +0000 (19:55 +0900)]
os: use wait6 to avoid wait/kill race on freebsd

This change is a followup to https://go-review.googlesource.com/23967
for FreeBSD.

Updates #13987.
Updates #16028.

Change-Id: I0f0737372fce6df89d090fe9847305749b79eb4c
Reviewed-on: https://go-review.googlesource.com/24021
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoos: use waitid to avoid wait/kill race on darwin
Mikio Hara [Sat, 11 Jun 2016 10:36:17 +0000 (19:36 +0900)]
os: use waitid to avoid wait/kill race on darwin

This change is a followup to https://go-review.googlesource.com/23967
for Darwin.

Updates #13987.
Updates #16028.

Change-Id: Ib1fb9f957fafd0f91da6fceea56620e29ad82b00
Reviewed-on: https://go-review.googlesource.com/24020
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: collect stack trace if SIGPROF arrives on non-Go thread
Ian Lance Taylor [Wed, 8 Jun 2016 04:46:25 +0000 (21:46 -0700)]
runtime: collect stack trace if SIGPROF arrives on non-Go thread

Fixes #15994.

Change-Id: I5aca91ab53985ac7dcb07ce094ec15eb8ec341f8
Reviewed-on: https://go-review.googlesource.com/23891
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/link: put padding between functions, not at the end of a function
Keith Randall [Sun, 12 Jun 2016 00:12:28 +0000 (17:12 -0700)]
cmd/link: put padding between functions, not at the end of a function

Functions should be declared to end after the last real instruction, not
after the last padding byte. We achieve this by adding the padding while
assembling the text section in the linker instead of adding the padding
to the function symbol in the compiler. This change makes dtrace happy.

TODO: check that this works with external linking

Fixes #15969

Change-Id: I973e478d0cd34b61be1ddc55410552cbd645ad62
Reviewed-on: https://go-review.googlesource.com/24040
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years ago[dev.ssa] cmd/compile: use MOVWaddr for address on ARM
Cherry Zhang [Tue, 7 Jun 2016 02:36:45 +0000 (22:36 -0400)]
[dev.ssa] cmd/compile: use MOVWaddr for address on ARM

Introduce an op MOVWaddr for addresses on ARM, instead of overuse
ADDconst.

Mark MOVWaddr as rematerializable. This fixes a liveness problem: if
it were not rematerializable, the address of a variable may be spilled
and later use of the address may just load the spilled value without
mentioning the variable, and the liveness code may think it is dead
prematurely.

Update #15365.

Change-Id: Ib0b0fa826bdb75c9e6bb362b95c6cf132cc6b1c0
Reviewed-on: https://go-review.googlesource.com/23942
Reviewed-by: David Chase <drchase@google.com>
8 years ago[dev.ssa] cmd/compile: ensure OffPtr has pointer type
Cherry Zhang [Wed, 8 Jun 2016 14:12:30 +0000 (10:12 -0400)]
[dev.ssa] cmd/compile: ensure OffPtr has pointer type

SSA treats SP as constant throughout a function, so as OffPtr [off] SP.
When the stack moves, spilled OffPtr values become invalid, if they are
not pointer-typed.

(Currently it is fine because of the optimization rules that folds OffPtr
into Load/Store. But it'd better be "optimization", not requirement.)

Updates #15365.

Change-Id: I76cf4008dfdc169e1cb5a55a2605b6678efc915d
Reviewed-on: https://go-review.googlesource.com/23941
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/compile: fix OASWB rewriting in racewalk
David Chase [Fri, 10 Jun 2016 15:51:46 +0000 (11:51 -0400)]
cmd/compile: fix OASWB rewriting in racewalk

Special case for rewriting OAS inits omitted OASWB, added
that and OAS2FUNC.  The special case cannot be default case,
that causes racewalk to fail in horrible ways.

Fixes #16008.

Change-Id: Ie0d2f5735fe9d8255a109597b36d196d4f86703a
Reviewed-on: https://go-review.googlesource.com/23954
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: remove invalid space in import comment docs
Dmitri Shuralyov [Fri, 10 Jun 2016 08:38:43 +0000 (01:38 -0700)]
cmd/go: remove invalid space in import comment docs

Generate package comment in alldocs.go using line comments rather than
general comments. This scales better, general comments cannot contain the
"*/" character sequence. Line comments do not have any restrictions on
the comment text that can be contained.

Remove the dependency on sed, which is not cross-platform, not go-gettable
external command.

Remove trailing whitespace from usage string in test.go. It's unnecessary.

Fixes #16030.

Change-Id: I3c0bc9955e7c7603c3d1fb4878218b0719d02e04
Reviewed-on: https://go-review.googlesource.com/23968
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: aeshash, xor seed in earlier
Keith Randall [Thu, 26 May 2016 15:56:49 +0000 (08:56 -0700)]
runtime: aeshash, xor seed in earlier

Instead of doing:

x = input
one round of aes on x
x ^= seed
two rounds of aes on x

Do:

x = input
x ^= seed
three rounds of aes on x

This change provides some additional seed-dependent scrambling
which should help prevent collisions.

Change-Id: I02c774d09c2eb6917cf861513816a1024a9b65d7
Reviewed-on: https://go-review.googlesource.com/23577
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoos: on GNU/Linux use waitid to avoid wait/kill race
Ian Lance Taylor [Fri, 10 Jun 2016 05:24:40 +0000 (22:24 -0700)]
os: on GNU/Linux use waitid to avoid wait/kill race

On systems that support the POSIX.1-2008 waitid function, we can use it
to block until a wait will succeed. This avoids a possible race
condition: if a program calls p.Kill/p.Signal and p.Wait from two
different goroutines, then it is possible for the wait to complete just
before the signal is sent. In that case, it is possible that the system
will start a new process using the same PID between the wait and the
signal, causing the signal to be sent to the wrong process. The
Process.isdone field attempts to avoid that race, but there is a small
gap of time between when wait returns and isdone is set when the race
can occur.

This CL avoids that race by using waitid to wait until the process has
exited without actually collecting the PID. Then it sets isdone, then
waits for any active signals to complete, and only then collects the PID.

No test because any plausible test would require starting enough
processes to recycle all the process IDs.

Update #13987.
Update #16028.

Change-Id: Id2939431991d3b355dfb22f08793585fc0568ce8
Reviewed-on: https://go-review.googlesource.com/23967
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agogo/parser: document that parse functions need valid token.FileSet
Robert Griesemer [Fri, 10 Jun 2016 17:27:37 +0000 (10:27 -0700)]
go/parser: document that parse functions need valid token.FileSet

+ panic with explicit error if no file set it provided

(Not providing a file set is invalid use of the API; panic
is the appropriate action rather than returning an error.)

Fixes #16018.

Change-Id: I207f5b2a2e318d65826bdd9522fce46d614c24ee
Reviewed-on: https://go-review.googlesource.com/24010
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/go: clarify go get documentation
Ian Lance Taylor [Thu, 9 Jun 2016 13:42:42 +0000 (06:42 -0700)]
cmd/go: clarify go get documentation

Make the documentation for `go get` match the documentation for `go
install`, since `go get` essentially invokes `go install`.

Update #15825.

Change-Id: I374d80efd301814b6d98b86b7a4a68dd09704c92
Reviewed-on: https://go-review.googlesource.com/23925
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agosyscall: add a padding field to EpollEvent on s390x
Michael Munday [Thu, 9 Jun 2016 16:01:43 +0000 (12:01 -0400)]
syscall: add a padding field to EpollEvent on s390x

Fixes #16021.

Change-Id: I55df38bbccd2641abcb54704115002a9aa04325d
Reviewed-on: https://go-review.googlesource.com/23962
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoencoding/csv: update doc about comments whitespace
Jess Frazelle [Fri, 20 May 2016 21:35:28 +0000 (14:35 -0700)]
encoding/csv: update doc about comments whitespace

This patch updates the doc about comments whitespace for the
encoding/csv package to reflect that leading whitespace before
the hash will treat the line as not a comment.

Fixes #13775.

Change-Id: Ia468c75b242a487b4b2b4cd3d342bfb8e07720ba
Reviewed-on: https://go-review.googlesource.com/23302
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: set $sp before $pc in gdb python script
Cherry Zhang [Thu, 9 Jun 2016 02:22:35 +0000 (22:22 -0400)]
runtime: set $sp before $pc in gdb python script

When setting $pc, gdb does a backtrace using the current value of $sp,
and it may complain if $sp does not match that $pc (although the
assignment went through successfully).

This happens with ARM SSA backend: when setting $pc it prints
> Cannot access memory at address 0x0

As well as occasionally on MIPS64:
> warning: GDB can't find the start of the function at 0xc82003fe07.
> ...

Setting $sp before setting $pc makes it happy.

Change-Id: Idd96dbef3e9b698829da553c6d71d5b4c6d492db
Reviewed-on: https://go-review.googlesource.com/23940
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agocmd/compile: for tail calls in stubs, ensure args are alive
Keith Randall [Thu, 9 Jun 2016 18:07:36 +0000 (11:07 -0700)]
cmd/compile: for tail calls in stubs, ensure args are alive

The generated code for interface stubs sometimes just messes
with a few of the args and then tail-calls to the target routine.
The args that aren't explicitly modified appear to not be used.
But they are used, by the thing we're tail calling.

Fixes #16016

Change-Id: Ib9b3a8311bb714a201daee002885fcb59e0463fa
Reviewed-on: https://go-review.googlesource.com/23960
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/cgo: fix use of unsafe argument in new deferred function
Ian Lance Taylor [Thu, 9 Jun 2016 18:19:26 +0000 (11:19 -0700)]
cmd/cgo: fix use of unsafe argument in new deferred function

The combination of https://golang.org/cl/23650 and
https://golang.org/cl/23675 did not work--they were tested separately
but not together.

The problem was that 23650 introduced deferred argument checking, and
the deferred function loses the type that 23675 started requiring. The
fix is to go back to using an empty interface type in a deferred
argument check.

No new test required--fixes broken build.

Change-Id: I5ea023c5aed71d70e57b11c4551242d3ef25986d
Reviewed-on: https://go-review.googlesource.com/23961
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agocmd/cgo: use function arg type for _cgoCheckPointerN function
Ian Lance Taylor [Thu, 2 Jun 2016 04:32:47 +0000 (21:32 -0700)]
cmd/cgo: use function arg type for _cgoCheckPointerN function

When cgo writes a _cgoCheckPointerN function to handle unsafe.Pointer,
use the function's argument type rather than interface{}. This permits
type errors to be detected at build time rather than run time.

Fixes #13830.

Change-Id: Ic7090905e16b977e2379670e0f83640dc192b565
Reviewed-on: https://go-review.googlesource.com/23675
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agotime: document that RFC822/1123 don't parse all RFC formats
Ian Lance Taylor [Thu, 9 Jun 2016 04:15:26 +0000 (21:15 -0700)]
time: document that RFC822/1123 don't parse all RFC formats

Fixes #14505.

Change-Id: I46196b26c9339609e6e3ef9159de38c5b50c2a1b
Reviewed-on: https://go-review.googlesource.com/23922
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agotime: genzabbrs.go skips Feb when checking months
Kenny Grant [Sat, 21 May 2016 16:19:22 +0000 (17:19 +0100)]
time: genzabbrs.go skips Feb when checking months

getAbbrs looks like it is checking each month looking for a change
in the time zone abbreviation, but starts in Dec of the previous year
and skips the month of February because of the overflow rules for
AddDate. Changing the day to 1 starts at Jan 1 and tries all months
in the current year. This isn't very important or likely to change
output as zones usually span several months. Discovered when
looking into time.AddDate behavior when adding months.

Change-Id: I685254c8d21c402ba82cc4176e9a86b64ce8f7f7
Reviewed-on: https://go-review.googlesource.com/23322
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocrypto/subtle: expand abbreviation to eliminate confusion
Jason Barnett [Tue, 24 May 2016 19:50:02 +0000 (15:50 -0400)]
crypto/subtle: expand abbreviation to eliminate confusion

Change-Id: I68d66fccf9cc8f7137c92b94820ce7d6f478a185
Reviewed-on: https://go-review.googlesource.com/23310
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoos: document that the runtime can write to standard error
Ian Lance Taylor [Thu, 9 Jun 2016 04:09:09 +0000 (21:09 -0700)]
os: document that the runtime can write to standard error

Fixes #15970.

Change-Id: I3f7d8316069a69d0e3859aaa96bc1414487fead0
Reviewed-on: https://go-review.googlesource.com/23921
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/go: only run TestGoGetHTTPS404 where it works
Ian Lance Taylor [Thu, 9 Jun 2016 00:45:55 +0000 (17:45 -0700)]
cmd/go: only run TestGoGetHTTPS404 where it works

The test TestGoGetHTTPS404 downloads a package that does not build on
every OS, so change it to only run where the package builds. It's not
great for the test to depend on an external package, but this is an
improvement on the current situation.

Fixes #15644.

Change-Id: I1679cee5ab1e61a5b26f4ad39dc8a397fbc0da69
Reviewed-on: https://go-review.googlesource.com/23920
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years ago[dev.ssa] cmd/compile: fix a few bugs for SSA for ARM
Cherry Zhang [Fri, 3 Jun 2016 22:03:29 +0000 (18:03 -0400)]
[dev.ssa] cmd/compile: fix a few bugs for SSA for ARM

- 64x signed right shift was wrong for shift larger than 0x80000000.
- for Lsh-followed-by-Rsh, the intermediate value should be full int
  width, so when it is spilled MOVW should be used.
- use RET for RetJmp, so the assembler can take case of restoring LR
  for non-leaf case.
- reserve R9 in dynlink mode. R9 is used for GOT by the assembler.

Progress on SSA backend for ARM. Still not complete.

Updates #15365.

Change-Id: I3caca256b92ff7cf96469da2feaf4868a592efc5
Reviewed-on: https://go-review.googlesource.com/23793
Reviewed-by: David Chase <drchase@google.com>
8 years ago[dev.ssa] cmd/compile: fix scheduling of tuple ops
Cherry Zhang [Wed, 1 Jun 2016 10:41:08 +0000 (06:41 -0400)]
[dev.ssa] cmd/compile: fix scheduling of tuple ops

We want tuple-reading ops immediately follow tuple-generating op, so
that tuple values will not be spilled/copied.

The mechanism introduced in the previous CL cannot really avoid tuples
interleaving. In this CL we always emit tuple and their selectors together.
Maybe remove the tuple scores if it does not help on performance (todo).

Also let tighten not move tuple-reading ops across blocks.

In the previous CL a special case of regenerating flags with tuple-reading
pseudo-op is added, but it did not cover end-of-block case. This is fixed
in this CL and the condition is generalized.

Progress on SSA backend for ARM. Still not complete.

Updates #15365.

Change-Id: I8980b34e7a64eb98153540e9e19a3782e20406ff
Reviewed-on: https://go-review.googlesource.com/23792
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/compile: nilcheck interface value in go/defer interface call for SSA
Cherry Zhang [Mon, 6 Jun 2016 20:00:33 +0000 (16:00 -0400)]
cmd/compile: nilcheck interface value in go/defer interface call for SSA

This matches the behavior of the legacy backend.

Fixes #15975 (if this is the intended behavior)

Change-Id: Id277959069b8b8bf9958fa8f2cbc762c752a1a19
Reviewed-on: https://go-review.googlesource.com/23820
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime/cgo: restore the g pointer correctly in crosscall_s390x
Michael Munday [Wed, 8 Jun 2016 16:11:44 +0000 (16:11 +0000)]
runtime/cgo: restore the g pointer correctly in crosscall_s390x

R13 needs to be set to g because C code may have clobbered R13.

Fixes #16006.

Change-Id: I66311fe28440e85e589a1695fa1c42416583b4c6
Reviewed-on: https://go-review.googlesource.com/23910
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agomisc/android: make the exec wrapper exit code parsing more robust
Elias Naur [Fri, 3 Jun 2016 09:41:26 +0000 (11:41 +0200)]
misc/android: make the exec wrapper exit code parsing more robust

Before, the Android exec wrapper expected the trailing exit code
output on its own line, like this:

PASS
exitcode=0

However, some tests can sometimes squeeze in some output after
the test harness outputs "PASS" and the newline. The
TestWriteHeapDumpFinalizers test is particularly prone to this,
since its finalizers println to standard out. When it happens, the
output looks like this:

PASS
finalizedexitcode=0

Two recent failures caused by this race:

https://build.golang.org/log/185605e1b936142c22350eef22d20e982be53c29
https://build.golang.org/log/e61cf6a050551d10360bd90be3c5f58c3eb07605

Since the "exitcode=" string is always echoed after the test output,
the fix is simple: instead of looking for the last newline in the
output, look for the last exitcode string instead.

Change-Id: Icd6e53855eeba60b982ad3108289d92549328b86
Reviewed-on: https://go-review.googlesource.com/23750
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agomisc/cgo/testsanitizers: don't run some TSAN tests on GCC < 7
Ian Lance Taylor [Tue, 7 Jun 2016 04:44:24 +0000 (21:44 -0700)]
misc/cgo/testsanitizers: don't run some TSAN tests on GCC < 7

Before GCC 7 defined __SANITIZE_THREAD__ when using TSAN,
runtime/cgo/libcgo.h could not determine reliably whether TSAN was in
use when using GCC.

Fixes #15983.

Change-Id: I5581c9f88e1cde1974c280008b2230fe5e971f44
Reviewed-on: https://go-review.googlesource.com/23833
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
8 years agonet/http: update bundled http2
Andrew Gerrand [Wed, 8 Jun 2016 02:57:00 +0000 (12:57 +1000)]
net/http: update bundled http2

Updates x/net/http2 to git rev 313cf39 for CLs 23812 and 23880:

http2: GotFirstResponseByte hook should only fire once
http2: fix data race on pipe

Fixes #16000

Change-Id: I9c3f1b2528bbd99968aa5a0529ae9c5295979d1d
Reviewed-on: https://go-review.googlesource.com/23881
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
8 years agocmd/compile: cgen_append can handle complex targets
Keith Randall [Tue, 7 Jun 2016 22:43:48 +0000 (15:43 -0700)]
cmd/compile: cgen_append can handle complex targets

Post-liveness fix, the slices on both sides can now be
indirects of & variables.  The cgen code handles those
cases just fine.

Fixes #15988

Change-Id: I378ad1d5121587e6107a9879c167291a70bbb9e4
Reviewed-on: https://go-review.googlesource.com/23863
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
8 years agocmd/compile: fix heap dump test on android
Keith Randall [Tue, 7 Jun 2016 16:54:09 +0000 (09:54 -0700)]
cmd/compile: fix heap dump test on android

go_android_exec is looking for "exitcode=" to decide the result
of running a test.  The heap dump test nondeterministically prints
"finalized" right at the end of the test.  When the timing is just
right, we print "finalizedexitcode=0" and confuse go_android_exec.

This failure happens occasionally on the android builders.

Change-Id: I4f73a4db05d8f40047ecd3ef3a881a4ae3741e26
Reviewed-on: https://go-review.googlesource.com/23861
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: use fake package for allocating autos
Keith Randall [Mon, 6 Jun 2016 17:56:42 +0000 (10:56 -0700)]
cmd/compile: use fake package for allocating autos

Make sure auto names don't conflict with function names. Before this CL,
we confused name a.len (the len field of the slice a) with a.len (the function
len declared on a).

Fixes #15961

Change-Id: I14913de697b521fb35db9a1b10ba201f25d552bb
Reviewed-on: https://go-review.googlesource.com/23789
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/dist: use "set" instead of "export" in diagnostic message
Andrew Gerrand [Mon, 6 Jun 2016 22:33:00 +0000 (08:33 +1000)]
cmd/dist: use "set" instead of "export" in diagnostic message

On Windows, "export" doesn't mean anything, but Windows users are the
most likely to see this message.

Fixes #15977

Change-Id: Ib09ca08a7580713cacb65d0cdc43730765c377a8
Reviewed-on: https://go-review.googlesource.com/23840
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: send StatusOK on empty body with TimeoutHandler
Andrew Gerrand [Mon, 6 Jun 2016 00:23:49 +0000 (10:23 +1000)]
net/http: send StatusOK on empty body with TimeoutHandler

Fixes #15948

Change-Id: Idd79859b3e98d61cd4e3ef9caa5d3b2524fd026a
Reviewed-on: https://go-review.googlesource.com/23810
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agotime: warn about correct use of a Timer's Stop/Reset methods
Andrew Gerrand [Tue, 31 May 2016 05:30:52 +0000 (15:30 +1000)]
time: warn about correct use of a Timer's Stop/Reset methods

Updates #14038
Fixes #14383

Change-Id: Icf6acb7c5d13ff1d3145084544c030a778482a38
Reviewed-on: https://go-review.googlesource.com/23575
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: send one Transfer-Encoding header when "chunked" set manually
Andrew Gerrand [Mon, 6 Jun 2016 00:41:47 +0000 (10:41 +1000)]
net/http: send one Transfer-Encoding header when "chunked" set manually

Fixes #15960

Change-Id: I7503f6ede33e6a1a93cee811d40f7b297edf47bc
Reviewed-on: https://go-review.googlesource.com/23811
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years ago[dev.ssa] cmd/compile: handle floating point on ARM
Cherry Zhang [Tue, 31 May 2016 15:27:16 +0000 (11:27 -0400)]
[dev.ssa] cmd/compile: handle floating point on ARM

Machine supports (or the runtime simulates in soft float mode)
(u)int32<->float conversions. The frontend rewrites int64<->float
conversions to call to runtime function.

For int64->float32 conversion, the frontend generates

.   .   AS u(100) l(10) tc(1)
.   .   .   NAME-main.~r1 u(1) a(true) g(1) l(9) x(8+0) class(PPARAMOUT) f(1) float32
.   .   .   CALLFUNC u(100) l(10) tc(1) float32
.   .   .   .   NAME-runtime.int64tofloat64 u(1) a(true) x(0+0) class(PFUNC) tc(1) used(true) FUNC-func(int64) float64

The CALLFUNC node has type float32, whereas runtime.int64tofloat64
returns float64. The legacy backend implicitly makes a float64->float32
conversion. The SSA backend does not do implicit conversion, so we
insert an explicit CONV here.

All cmd/compile/internal/gc/testdata/*_ssa.go tests passed.

Progress on SSA for ARM. Still not complete.

Update #15365.

Change-Id: I30937c8ff977271246b068f48224693776804339
Reviewed-on: https://go-review.googlesource.com/23652
Reviewed-by: Keith Randall <khr@golang.org>
8 years agoruntime: fix typo
Keith Randall [Sun, 5 Jun 2016 16:24:09 +0000 (09:24 -0700)]
runtime: fix typo

Fixes #15962

Change-Id: I1949e0787f6c2b1e19b9f9d3af2f712606a6d4cf
Reviewed-on: https://go-review.googlesource.com/23786
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years ago[dev.ssa] cmd/compile: handle Div, Convert, GetClosurePtr etc. on ARM
Cherry Zhang [Wed, 25 May 2016 13:49:28 +0000 (09:49 -0400)]
[dev.ssa] cmd/compile: handle Div, Convert, GetClosurePtr etc. on ARM

This CL adds support of Div, Mod, Convert, GetClosurePtr and 64-bit indexing
support to SSA backend for ARM.

Add tests for 64-bit indexing to cmd/compile/internal/gc/testdata/string_ssa.go.

Tests cmd/compile/internal/gc/testdata/*_ssa.go passed, except compound_ssa.go
and fp_ssa.go.

Progress on SSA for ARM. Still not complete. Essentially the only unsupported
part is floating point.

Updates #15365.

Change-Id: I269e88b67f641c25e7a813d910c96d356d236bff
Reviewed-on: https://go-review.googlesource.com/23542
Reviewed-by: David Chase <drchase@google.com>
8 years agoRevert "cmd/go: re-enable TestCgoConsistentResults on solaris"
Mikio Hara [Fri, 3 Jun 2016 22:33:28 +0000 (07:33 +0900)]
Revert "cmd/go: re-enable TestCgoConsistentResults on solaris"

This reverts commit b89bcc1daeed9980c5ba8a255b37877493952874.

Change-Id: Ief2f317ffc175f7e6002d0c39694876f46788c69
Reviewed-on: https://go-review.googlesource.com/23744
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
8 years agocmd/go: re-enable TestCgoConsistentResults on solaris
Mikio Hara [Fri, 3 Jun 2016 07:45:21 +0000 (16:45 +0900)]
cmd/go: re-enable TestCgoConsistentResults on solaris

Updates #13247.

Change-Id: If5e4c9f4db05f58608b0eeed1a2312a04015b207
Reviewed-on: https://go-review.googlesource.com/23741
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/cgo: check pointers for deferred C calls at the right time
Ian Lance Taylor [Wed, 1 Jun 2016 22:24:14 +0000 (15:24 -0700)]
cmd/cgo: check pointers for deferred C calls at the right time

We used to check time at the point of the defer statement. This change
fixes cgo to check them when the deferred function is executed.

Fixes #15921.

Change-Id: I72a10e26373cad6ad092773e9ebec4add29b9561
Reviewed-on: https://go-review.googlesource.com/23650
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agodoc/go1.7.html: html tidy
Ian Lance Taylor [Fri, 3 Jun 2016 19:39:54 +0000 (12:39 -0700)]
doc/go1.7.html: html tidy

Change-Id: I0e07610bae641cd63769b520089f5d854d796648
Reviewed-on: https://go-review.googlesource.com/23770
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/go: match go-import package prefixes by slash
Stephen McQuay (smcquay) [Fri, 3 Jun 2016 09:12:17 +0000 (02:12 -0700)]
cmd/go: match go-import package prefixes by slash

The existing implementation for path collision resolution would
incorrectly determine that:

    example.org/aa

collides with:

    example.org/a

This change splits by slash rather than comparing on a byte-by-byte
basis.

Fixes: #15947
Change-Id: I18b3aaafbc787c81253203cf1328bb3c4420a0c4
Reviewed-on: https://go-review.googlesource.com/23732
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

8 years agoreflect: clear tflag for StructOf type
David Crawshaw [Fri, 3 Jun 2016 15:27:33 +0000 (11:27 -0400)]
reflect: clear tflag for StructOf type

Fixes #15923

Change-Id: I3e56564365086ceb0bfc15db61db6fb446ab7448
Reviewed-on: https://go-review.googlesource.com/23760
Reviewed-by: Sebastien Binet <seb.binet@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime/cgo: add TSAN locks around mmap call
Ian Lance Taylor [Fri, 3 Jun 2016 17:49:24 +0000 (10:49 -0700)]
runtime/cgo: add TSAN locks around mmap call

Change-Id: I806cc5523b7b5e3278d01074bc89900d78700e0c
Reviewed-on: https://go-review.googlesource.com/23736
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agodoc/go1.7.html: add missing <code> and </a>
Ian Lance Taylor [Fri, 3 Jun 2016 17:09:08 +0000 (10:09 -0700)]
doc/go1.7.html: add missing <code> and </a>

Change-Id: I5f4bf89345dc139063dcf34da653e914386bcde6
Reviewed-on: https://go-review.googlesource.com/23735
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/link: avoid name collision with DWARF .def suffix
Ian Lance Taylor [Fri, 3 Jun 2016 14:11:52 +0000 (07:11 -0700)]
cmd/link: avoid name collision with DWARF .def suffix

Adding a .def suffix for DWARF info collided with the DWARF info,
without the suffix, for a method named def. Change the suffix to ..def
instead.

Fixes #15926.

Change-Id: If1bf1bcb5dff1d7f7b79f78e3f7a3bbfcd2201bb
Reviewed-on: https://go-review.googlesource.com/23733
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agonet: don't leak test helper goroutine in TestAcceptTimeout
Mikio Hara [Fri, 3 Jun 2016 09:06:54 +0000 (18:06 +0900)]
net: don't leak test helper goroutine in TestAcceptTimeout

Fixes #15109.

Change-Id: Ibfdedd6807322ebec84bacfeb492fb53fe066960
Reviewed-on: https://go-review.googlesource.com/23742
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
8 years agobytes: use Run method for benchmarks
Marcel van Lohuizen [Thu, 26 May 2016 08:54:25 +0000 (10:54 +0200)]
bytes: use Run method for benchmarks

Change-Id: I34ab1003099570f0ba511340e697a648de31d08a
Reviewed-on: https://go-review.googlesource.com/23427
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
8 years agocmd/internal/obj, runtime: fixes for defer in 386 shared libraries
Michael Hudson-Doyle [Wed, 1 Jun 2016 23:07:55 +0000 (11:07 +1200)]
cmd/internal/obj, runtime: fixes for defer in 386 shared libraries

Any defer in a shared object crashed when GOARCH=386. This turns out to be two
bugs:

 1) Calls to morestack were not processed to be PIC safe (must have been
    possible to trigger this another way too)
 2) jmpdefer needs to rewind the return address of the deferred function past
    the instructions that load the GOT pointer into BX, not just past the call

Bug 2) requires re-introducing the a way for .s files to know when they are
being compiled for dynamic linking but I've tried to do that in as minimal
a way as possible.

Fixes #15916

Change-Id: Ia0d09b69ec272a176934176b8eaef5f3bfcacf04
Reviewed-on: https://go-review.googlesource.com/23623
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/go: fix staleness test for releases, also deflake it
Andrew Gerrand [Fri, 3 Jun 2016 01:33:37 +0000 (11:33 +1000)]
cmd/go: fix staleness test for releases, also deflake it

Fixes #15933

Change-Id: I2cd6365e6d0ca1cafdc812fbfaaa55aa64b2b289
Reviewed-on: https://go-review.googlesource.com/23731
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc/go1.7.html: net/mail.ParseAddress is stricter
Ian Lance Taylor [Thu, 2 Jun 2016 19:33:34 +0000 (12:33 -0700)]
doc/go1.7.html: net/mail.ParseAddress is stricter

Fixes #15940.

Change-Id: Ie6da6fef235c6a251caa96d45f606c05d118a0ac
Reviewed-on: https://go-review.googlesource.com/23710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Travis Beatty <travisby@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agoencoding/json: fix docs on valid key names
David Glasser [Tue, 31 May 2016 19:28:57 +0000 (12:28 -0700)]
encoding/json: fix docs on valid key names

This has been inaccurate since https://golang.org/cl/6048047.

Fixes #15317.

Change-Id: If93d2161f51ccb91912cb94a35318cf33f4d526a
Reviewed-on: https://go-review.googlesource.com/23691
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agosyscall: deflake TestUnshare
Mikio Hara [Thu, 2 Jun 2016 08:17:02 +0000 (17:17 +0900)]
syscall: deflake TestUnshare

Change-Id: I21a08c2ff5ebb74e158723cca323574432870ba8
Reviewed-on: https://go-review.googlesource.com/23662
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agostrconv: use Run for some benchmarks
Marcel van Lohuizen [Thu, 26 May 2016 10:10:28 +0000 (12:10 +0200)]
strconv: use Run for some benchmarks

This serves as an example of table-driven benchmarks which are analoguous to the common pattern for table-driven tests.

Change-Id: I47f94c121a7117dd1e4ba03b3f2f8bcb5da38063
Reviewed-on: https://go-review.googlesource.com/23470
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
8 years agoruntime: only permit SetCgoTraceback to be called once
Ian Lance Taylor [Thu, 2 Jun 2016 19:01:03 +0000 (12:01 -0700)]
runtime: only permit SetCgoTraceback to be called once

Accept a duplicate call, but nothing else.

Change-Id: Iec24bf5ddc3b0f0c559ad2158339aca698601743
Reviewed-on: https://go-review.googlesource.com/23692
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime/cgo: avoid races on cgo_context_function
Ian Lance Taylor [Tue, 31 May 2016 23:04:00 +0000 (16:04 -0700)]
runtime/cgo: avoid races on cgo_context_function

Change-Id: Ie9e6fda675e560234e90b9022526fd689d770818
Reviewed-on: https://go-review.googlesource.com/23610
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agosyscall: call setgroups for no groups on GNU/Linux
Alexander Morozov [Fri, 27 May 2016 22:02:31 +0000 (15:02 -0700)]
syscall: call setgroups for no groups on GNU/Linux

Skip setgroups only for one particular case: GidMappings != nil and
GidMappingsEnableSetgroup == false and list of supplementary groups is
empty.
This patch returns pre-1.5 behavior for simple exec and still allows to
use GidMappings with non-empty Credential.

Change-Id: Ia91c77e76ec5efab7a7f78134ffb529910108fc1
Reviewed-on: https://go-review.googlesource.com/23524
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc/go1.7.html: typo fix; replace "," at end of sentence with "."
Steve Phillips [Thu, 2 Jun 2016 09:40:37 +0000 (02:40 -0700)]
doc/go1.7.html: typo fix; replace "," at end of sentence with "."

Signed-off-by: Steven Phillips <steve@tryingtobeawesome.com>
Change-Id: Ie7c3253a5e1cd43be8fa12bad340204cc6c5ca76
Reviewed-on: https://go-review.googlesource.com/23677
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc/go1.7: fix typo in nsswitch.conf name
Alberto Donizetti [Thu, 2 Jun 2016 12:34:37 +0000 (14:34 +0200)]
doc/go1.7: fix typo in nsswitch.conf name

Fixes #15939

Change-Id: I120cbeac73a052fb3f328774e6d5e1534f11bf6b
Reviewed-on: https://go-review.googlesource.com/23682
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoreflect: document StructOf embedded fields limitation
Sebastien Binet [Thu, 2 Jun 2016 07:25:30 +0000 (09:25 +0200)]
reflect: document StructOf embedded fields limitation

This CL documents that StructOf currently does not generate wrapper
methods for embedded fields.

Updates #15924

Change-Id: I932011b1491d68767709559f515f699c04ce70d4
Reviewed-on: https://go-review.googlesource.com/23681
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/dist: skip an unsupported test on darwin/arm
Elias Naur [Thu, 2 Jun 2016 13:42:14 +0000 (15:42 +0200)]
cmd/dist: skip an unsupported test on darwin/arm

Fixes the darwin/arm builder (I hope)

Change-Id: I8a3502a1cdd468d4bf9a1c895754ada420b305ce
Reviewed-on: https://go-review.googlesource.com/23684
Run-TryBot: Elias Naur <elias.naur@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agomisc/cgo/test: fix issue9400 test on android/386
Elias Naur [Thu, 2 Jun 2016 13:00:34 +0000 (15:00 +0200)]
misc/cgo/test: fix issue9400 test on android/386

The test for #9400 relies on an assembler function that manipulates
the stack pointer. Meanwile, it uses a global variable for
synchronization. However, position independent code on 386 use a
function call to fetch the base address for global variables.
That function call in turn overwrites the Go stack.

Fix that by fetching the global variable address once before the
stack register manipulation.

Fixes the android/386 builder.

Change-Id: Ib77bd80affaa12f09d582d09d8b84a73bd021b60
Reviewed-on: https://go-review.googlesource.com/23683
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years ago[dev.ssa] cmd/compile: handle 64-bit shifts on ARM
Cherry Zhang [Thu, 26 May 2016 03:17:42 +0000 (23:17 -0400)]
[dev.ssa] cmd/compile: handle 64-bit shifts on ARM

Also fix a mistake in previous CL about x8 and x16 shifts:
the shift needs ZeroExt.

Progress on SSA for ARM. Still not complete.

Updates #15365.

Change-Id: Ibc352760023d38bc6b9c5251e929fe26e016637a
Reviewed-on: https://go-review.googlesource.com/23486
Reviewed-by: David Chase <drchase@google.com>
8 years ago[dev.ssa] cmd/compile: clean up hardcoded regmasks in ssa/regalloc.go
Cherry Zhang [Thu, 19 May 2016 16:33:30 +0000 (12:33 -0400)]
[dev.ssa] cmd/compile: clean up hardcoded regmasks in ssa/regalloc.go

Auto-generate register masks and load them through Config.

Passed toolstash -cmp on AMD64.

Tests phi_ssa.go and regalloc_ssa.go in cmd/compile/internal/gc/testdata
passed on ARM.

Updates #15365.

Change-Id: I393924d68067f2dbb13dab82e569fb452c986593
Reviewed-on: https://go-review.googlesource.com/23292
Reviewed-by: David Chase <drchase@google.com>
8 years ago[dev.ssa] cmd/compile: decompose 64-bit integer on ARM
Cherry Zhang [Wed, 18 May 2016 22:14:36 +0000 (18:14 -0400)]
[dev.ssa] cmd/compile: decompose 64-bit integer on ARM

Introduce dec64 rules to (generically) decompose 64-bit integer on
32-bit architectures. 64-bit integer is composed/decomposed with
Int64Make/Hi/Lo ops, as for complex types.

The idea of dealing with Add64 is the following:

(Add64 (Int64Make xh xl) (Int64Make yh yl))
->
(Int64Make
(Add32withcarry xh yh (Select0 (Add32carry xl yl)))
(Select1 (Add32carry xl yl)))

where Add32carry returns a tuple (flags,uint32). Select0 and Select1
read the first and the second component of the tuple, respectively.
The two Add32carry will be CSE'd.

Similarly for multiplication, Mul32uhilo returns a tuple (hi, lo).

Also add support of KeepAlive, to fix build after merge.

Tests addressed_ssa.go, array_ssa.go, break_ssa.go, chan_ssa.go,
cmp_ssa.go, ctl_ssa.go, map_ssa.go, and string_ssa.go in
cmd/compile/internal/gc/testdata passed.

Progress on SSA for ARM. Still not complete.

Updates #15365.

Change-Id: I7867c76785a456312de5d8398a6b3f7ca5a4f7ec
Reviewed-on: https://go-review.googlesource.com/23213
Reviewed-by: Keith Randall <khr@golang.org>
8 years agomisc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS
Elias Naur [Wed, 1 Jun 2016 20:51:30 +0000 (22:51 +0200)]
misc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS

For #15919

Change-Id: I9fc38d9c8a9cc9406b551315e1599750fe212d0d
Reviewed-on: https://go-review.googlesource.com/23635
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: fix typo in comment
Dmitry Vyukov [Thu, 2 Jun 2016 05:43:21 +0000 (07:43 +0200)]
runtime: fix typo in comment

Change-Id: I82e35770b45ccd1433dfae0af423073c312c0859
Reviewed-on: https://go-review.googlesource.com/23680
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agonet/http: http.Request.Context doc fix
Anmol Sethi [Thu, 2 Jun 2016 02:35:09 +0000 (22:35 -0400)]
net/http: http.Request.Context doc fix

The comment on http.Request.Context says that the context
is canceled when the client's connection closes even though
this has not been implemented. See #15927

Change-Id: I50b68638303dafd70f77f8f778e6caff102d3350
Reviewed-on: https://go-review.googlesource.com/23672
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: mention net/http/httptrace package in release notes
Andrew Gerrand [Thu, 2 Jun 2016 04:31:16 +0000 (14:31 +1000)]
doc: mention net/http/httptrace package in release notes

Updates #15810

Change-Id: I689e18409a88c9e8941aa2e98f472c331efd455e
Reviewed-on: https://go-review.googlesource.com/23674
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc/go1.7.html: fix spelling of cancelation
Ian Lance Taylor [Thu, 2 Jun 2016 04:09:58 +0000 (21:09 -0700)]
doc/go1.7.html: fix spelling of cancelation

We say "cancelation," not "cancellation."

Fixes #15928.

Change-Id: I66d545404665948a27281133cb9050eebf1debbb
Reviewed-on: https://go-review.googlesource.com/23673
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: do not generate tail calls when dynamic linking on ppc64le
Michael Hudson-Doyle [Fri, 27 May 2016 03:41:55 +0000 (15:41 +1200)]
cmd/compile: do not generate tail calls when dynamic linking on ppc64le

When a wrapper method calls the real implementation, it's not possible to use a
tail call when dynamic linking on ppc64le. The bad scenario is when a local
call is made to the wrapper: the wrapper will call the implementation, which
might be in a different module and so set the TOC to the appropriate value for
that module. But if it returns directly to the wrapper's caller, nothing will
reset it to the correct value for that function.

Change-Id: Icebf24c9a2a0a9a7c2bce6bd6f1358657284fb10
Reviewed-on: https://go-review.googlesource.com/23468
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agovendor: update vendored route
Mikio Hara [Wed, 1 Jun 2016 23:53:11 +0000 (08:53 +0900)]
vendor: update vendored route

Updates golang.org/x/net/route to rev fac978c for:
- route: fix typos in test

Change-Id: I35de1d3f8e887c6bb5fe50e7299f2fc12e4426de
Reviewed-on: https://go-review.googlesource.com/23660
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoapi: promote next.txt to go1.7.txt and update api tool go1.7beta1
Andrew Gerrand [Thu, 2 Jun 2016 00:00:23 +0000 (10:00 +1000)]
api: promote next.txt to go1.7.txt and update api tool

Change-Id: Idb348be00f949da553aa6aab62836f59dfee298d
Reviewed-on: https://go-review.googlesource.com/23671
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>

8 years agoapi: remove os.File.Size and http.Transport.Dialer
Andrew Gerrand [Wed, 1 Jun 2016 23:59:06 +0000 (09:59 +1000)]
api: remove os.File.Size and http.Transport.Dialer

This method and field were added and then later removed during the 1.7
development cycle.

Change-Id: I0482a6356b91d2be67880b44ef5d8a1daab49ec8
Reviewed-on: https://go-review.googlesource.com/23670
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agoapi: update next.txt
Andrew Gerrand [Wed, 1 Jun 2016 23:24:43 +0000 (09:24 +1000)]
api: update next.txt

Change-Id: I04da6a56382d3bd96e3c849a022618553039b2db
Reviewed-on: https://go-review.googlesource.com/23651
Reviewed-by: Chris Broadfoot <cbro@golang.org>
8 years agocrypto/tls: buffer handshake messages.
Adam Langley [Wed, 1 Jun 2016 21:41:09 +0000 (14:41 -0700)]
crypto/tls: buffer handshake messages.

This change causes TLS handshake messages to be buffered and written in
a single Write to the underlying net.Conn.

There are two reasons to want to do this:

Firstly, it's slightly preferable to do this in order to save sending
several, small packets over the network where a single one will do.

Secondly, since 37c28759ca46cf381a466e32168a793165d9c9e9 errors from
Write have been returned from a handshake. This means that, if a peer
closes the connection during a handshake, a “broken pipe” error may
result from tls.Conn.Handshake(). This can mask any, more detailed,
fatal alerts that the peer may have sent because a read will never
happen.

Buffering handshake messages means that the peer will not receive, and
possibly reject, any of a flow while it's still being written.

Fixes #15709

Change-Id: I38dcff1abecc06e52b2de647ea98713ce0fb9a21
Reviewed-on: https://go-review.googlesource.com/23609
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agonet/http: update bundled http2
Tom Bergan [Fri, 27 May 2016 23:53:13 +0000 (16:53 -0700)]
net/http: update bundled http2

Updates x/net/http2 to git rev 6bdd4be4 for CL 23526:

  http2: GotFirstResponseByte hook should only fire once

Also updated the trace hooks test to verify that all trace hooks are called
exactly once except ConnectStart/End, which may be called multiple times (due
to happy-eyeballs).

Fixes #15777

Change-Id: Iea5c64eb322b58be27f9ff863b3a6f90e996fa9b
Reviewed-on: https://go-review.googlesource.com/23527
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: revert copyright date to 2009
Andrew Gerrand [Wed, 1 Jun 2016 22:11:01 +0000 (08:11 +1000)]
doc: revert copyright date to 2009

Somehow this date was changed in error (by me) to 2012.
It should have always been 2009.

Change-Id: I87029079458d4c4eeeff2f2fc0574f10afa9af09
Reviewed-on: https://go-review.googlesource.com/23622
Reviewed-by: Rob Pike <r@golang.org>
8 years agomisc/cgo/test,cmd/dist: enable (most) Cgo tests on Android
Elias Naur [Wed, 1 Jun 2016 18:58:02 +0000 (20:58 +0200)]
misc/cgo/test,cmd/dist: enable (most) Cgo tests on Android

Some tests cannot build for Android; use build tags and stubs to
skip them.

For #15919

Change-Id: Ieedcb73d4cabe23c3775cfb1d44c1276982dccd9
Reviewed-on: https://go-review.googlesource.com/23634
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
8 years agocmd/compile: correctly export underlying type of predecl. error type
Robert Griesemer [Wed, 1 Jun 2016 20:46:49 +0000 (13:46 -0700)]
cmd/compile: correctly export underlying type of predecl. error type

Fixes #15920.

Change-Id: I78cd79b91a58d0f7218b80f9445417f4ee071a6e
Reviewed-on: https://go-review.googlesource.com/23606
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agomath/big: avoid panic in float.Text with negative prec
Alberto Donizetti [Wed, 1 Jun 2016 17:16:56 +0000 (19:16 +0200)]
math/big: avoid panic in float.Text with negative prec

Fixes #15918

Change-Id: I4b434aed262960a2e6c659d4c2296fbf662c3a52
Reviewed-on: https://go-review.googlesource.com/23633
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: document heap scavenger memory summary
Emmanuel Odeke [Sun, 22 May 2016 09:20:11 +0000 (02:20 -0700)]
runtime: document heap scavenger memory summary

Fixes #15212.

Change-Id: I2628ec8333330721cddc5145af1ffda6f3e0c63f
Reviewed-on: https://go-review.googlesource.com/23319
Reviewed-by: Austin Clements <austin@google.com>
8 years agoos/signal: deflake TestReset/TestIgnore
Ian Lance Taylor [Wed, 1 Jun 2016 16:31:31 +0000 (09:31 -0700)]
os/signal: deflake TestReset/TestIgnore

Fixes #15661.

Change-Id: Ic3a8296fc7107f491880900ef52563e52caca1a3
Reviewed-on: https://go-review.googlesource.com/23615
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: for arm, zero unaligned memory 1 byte at a time
Keith Randall [Tue, 31 May 2016 21:55:12 +0000 (14:55 -0700)]
cmd/compile: for arm, zero unaligned memory 1 byte at a time

If memory might be unaligned, zero it one byte at a time
instead of 4 bytes at a time.

Fixes #15902

Change-Id: I4eff0840e042e2f137c1a4028f08793eb7dfd703
Reviewed-on: https://go-review.googlesource.com/23587
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
8 years agocmd/compile: fix TestAssembly on Plan 9
David du Colombier [Wed, 1 Jun 2016 13:13:55 +0000 (15:13 +0200)]
cmd/compile: fix TestAssembly on Plan 9

Since CL 23620, TestAssembly is failing on Plan 9.

In CL 23620, the process environment is passed to 'go tool compile'
after setting GOARCH. On Plan 9, if GOARCH is already set in the
process environment, it would take precedence. On Unix, it works
as expected because the first GOARCH found takes precedence.

This change uses the mergeEnvLists function from cmd/go/main.go
to merge the two environment lists such that variables with the
same name in "in" replace those in "out".

Change-Id: Idee22058343932ee18666dda331c562c89c33507
Reviewed-on: https://go-review.googlesource.com/23593
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc: rename Unshare to Unshareflags in go1.7 release notes
Dan Peterson [Wed, 1 Jun 2016 12:44:38 +0000 (09:44 -0300)]
doc: rename Unshare to Unshareflags in go1.7 release notes

Implementation changed in https://golang.org/cl/23612.

Updates #15810

Change-Id: I8fff9e3aa3e54162546bb9ec1cc2ebba2b6d9fed
Reviewed-on: https://go-review.googlesource.com/23614
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoregexp: use Run for benchmark
Marcel van Lohuizen [Thu, 26 May 2016 09:46:19 +0000 (11:46 +0200)]
regexp: use Run for benchmark

Change-Id: I4d19e3221d3789d4c460b421b2d1484253778068
Reviewed-on: https://go-review.googlesource.com/23429
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>

8 years agosyscall: rename SysProcAttr.Unshare to Unshareflags
Alexander Morozov [Wed, 1 Jun 2016 02:44:48 +0000 (19:44 -0700)]
syscall: rename SysProcAttr.Unshare to Unshareflags

For symmetry with Cloneflags and it looks slightly weird because there
is syscall.Unshare method.

Change-Id: I3d710177ca8f27c05b344407f212cbbe3435094b
Reviewed-on: https://go-review.googlesource.com/23612
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agocmd/compile: pass process env to 'go tool compile' in compileToAsm
Michael Hudson-Doyle [Wed, 1 Jun 2016 01:32:53 +0000 (13:32 +1200)]
cmd/compile: pass process env to 'go tool compile' in compileToAsm

In particular, this stops the test failing when GOROOT and GOROOT_FINAL are
different.

Change-Id: Ibf6cc0a173f1d965ee8aa31eee2698b223f1ceec
Reviewed-on: https://go-review.googlesource.com/23620
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocontext: fix typo in comments
Kenny Grant [Tue, 31 May 2016 21:30:37 +0000 (22:30 +0100)]
context: fix typo in comments

Change-Id: I41310ec88c889fda79d80eaf4a742a1000284f60
Reviewed-on: https://go-review.googlesource.com/23591
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocrypto/tls: remove unused variable in benchmark code
Robert Griesemer [Sat, 28 May 2016 02:47:55 +0000 (19:47 -0700)]
crypto/tls: remove unused variable in benchmark code

This fixes `go test go/types`.

https://golang.org/cl/23487/ introduced this code which contains
two unused variables (declared and assigned to, but never read).
cmd/compile doesn't report the error due open issue #8560 (the
variables are assigned to in a closure), but go/types does. The
build bot only runs go/types tests in -short mode (which doesn't
typecheck the std lib), hence this doesn't show up on the dashboard
either.

We cannot call b.Fatal and friends in the goroutine. Communicating
the error to the invoking function requires a channel or a mutex.
Unless the channel/sycnhronized variable is tested in each iteration
that follows, the iteration blocks if there's a failure. Testing in
each iteration may affect benchmark times.

One could use a time-out but that time depends on the underlying system.
Panicking seems good enough in this unlikely case; better than hanging
or affecting benchmark times.

Change-Id: Idce1172da8058e580fa3b3e398825b0eb4316325
Reviewed-on: https://go-review.googlesource.com/23528
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/compile: test non-constant shifts
Keith Randall [Tue, 31 May 2016 20:48:29 +0000 (13:48 -0700)]
cmd/compile: test non-constant shifts

Test all the weird shifts, like int8 shifted right by uint16.
Increases coverage for shift lowerings in AMD64.rules.

Change-Id: I066fe6ad6bfc05253a8d6a2ee17ff244d3a7652e
Reviewed-on: https://go-review.googlesource.com/23585
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>