]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
7 years agoreadme: add attribution for the Gopher image
Chris Broadfoot [Fri, 3 Feb 2017 00:43:24 +0000 (16:43 -0800)]
readme: add attribution for the Gopher image

Change-Id: I3b1317f0ab46e03d8c5a0af74c83183710a75055
Reviewed-on: https://go-review.googlesource.com/36214
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
7 years agotime: record monotonic clock reading in time.Now, for more accurate comparisons
Russ Cox [Thu, 2 Feb 2017 21:20:58 +0000 (16:20 -0500)]
time: record monotonic clock reading in time.Now, for more accurate comparisons

See https://golang.org/design/12914-monotonic for details.

Fixes #12914.

Change-Id: I80edc2e6c012b4ace7161c84cf067d444381a009
Reviewed-on: https://go-review.googlesource.com/36255
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Caleb Spare <cespare@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agocmd/compile: make sure output params are live if there is a defer
Keith Randall [Mon, 30 Jan 2017 22:55:12 +0000 (14:55 -0800)]
cmd/compile: make sure output params are live if there is a defer

If there is a defer, and that defer recovers, then the caller
can see all of the output parameters.  That means that we must
mark all the output parameters live at any point which might panic.

If there is no defer then this is not necessary.  This is implemented.

We could also detect whether there is a recover in any of the defers.
If not, we would need to mark only output params that the defer
actually references (and the closure mechanism already does that).
This is not implemented.

Fixes #18860.

Change-Id: If984fe6686eddce9408bf25e725dd17fc16b8578
Reviewed-on: https://go-review.googlesource.com/36030
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agocmd/compile: optimize (ZeroExt (Const [c]))
Josh Bleecher Snyder [Fri, 3 Feb 2017 06:38:04 +0000 (22:38 -0800)]
cmd/compile: optimize (ZeroExt (Const [c]))

These rules trigger 116 times while running make.bash.
And at least for the sample code at
https://github.com/golang/go/issues/18906#issuecomment-277174241
they are providing optimizations not already present
in amd64.

Updates #18906

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

7 years agocmd/compile: speed up hot phi insertion code
Josh Bleecher Snyder [Thu, 19 Jan 2017 22:22:26 +0000 (14:22 -0800)]
cmd/compile: speed up hot phi insertion code

This speeds up compilation of the code in #8225 by 25%-30%.
The complexity of the algorithm is unchanged,
but this shrinks the constant factor so much that it doesn't matter,
even the size of the giant type switch gets scaled up dramatically.

name       old time/op      new time/op      delta
Template        218ms ± 5%       217ms ±10%    ~           (p=0.163 n=27+30)
Unicode        98.2ms ± 6%      97.7ms ±10%    ~           (p=0.150 n=27+29)
GoTypes         654ms ± 5%       650ms ± 5%    ~           (p=0.350 n=30+30)
Compiler        2.70s ± 4%       2.68s ± 3%    ~           (p=0.128 n=30+29)

name       old user-ns/op   new user-ns/op   delta
Template   276user-ms ± 6%  271user-ms ± 7%  -1.83%        (p=0.003 n=29+28)
Unicode    138user-ms ± 5%  137user-ms ± 4%    ~           (p=0.071 n=27+27)
GoTypes    881user-ms ± 4%  877user-ms ± 4%    ~           (p=0.423 n=30+30)
Compiler   3.76user-s ± 4%  3.72user-s ± 2%  -0.84%        (p=0.028 n=30+29)

name       old alloc/op     new alloc/op     delta
Template       40.7MB ± 0%      40.7MB ± 0%    ~           (p=0.936 n=30+30)
Unicode        30.8MB ± 0%      30.8MB ± 0%    ~           (p=0.859 n=28+30)
GoTypes         123MB ± 0%       123MB ± 0%    ~           (p=0.273 n=30+30)
Compiler        472MB ± 0%       472MB ± 0%    ~           (p=0.432 n=30+30)

name       old allocs/op    new allocs/op    delta
Template         401k ± 1%        401k ± 1%    ~           (p=0.859 n=30+30)
Unicode          331k ± 0%        331k ± 1%    ~           (p=0.823 n=28+30)
GoTypes         1.24M ± 0%       1.24M ± 0%    ~           (p=0.286 n=30+30)
Compiler        4.26M ± 0%       4.26M ± 0%    ~           (p=0.359 n=30+30)

Change-Id: Ia850065a9a84c07a5b0b4e23c1758b5679498da7
Reviewed-on: https://go-review.googlesource.com/36112
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agoruntime: darwin/amd64, don't depend on outarg slots being unmodified
Keith Randall [Fri, 3 Feb 2017 02:50:45 +0000 (18:50 -0800)]
runtime: darwin/amd64, don't depend on outarg slots being unmodified

sigtramp was calling sigtrampgo and depending on the fact that
the 3rd argument slot will not be modified on return.  Our calling
convention doesn't guarantee that.  Avoid that assumption.

There's no actual bug here, as sigtrampgo does not in fact modify its
argument slots.  But I found this while working on the dead stack slot
clobbering tool.  https://go-review.googlesource.com/c/23924/

Change-Id: Ia7e791a2b4c1c74fff24cba8169e7840b4b06ffc
Reviewed-on: https://go-review.googlesource.com/36216
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agonet/http: fix dns hijacking test
Russ Cox [Fri, 3 Feb 2017 01:37:29 +0000 (20:37 -0500)]
net/http: fix dns hijacking test

The name lookups are unrooted; the test should be unrooted too.
Correctly skips the tests if the DNS config specifies a domain
suffix that has a wildcard entry causing all unrooted names to resolve.

Change-Id: I80470326a5d332f3b8d64663f765fd304c5e0811
Reviewed-on: https://go-review.googlesource.com/36253
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/compile: add reusable []Location to ssa.Config
Josh Bleecher Snyder [Fri, 27 Jan 2017 20:01:05 +0000 (12:01 -0800)]
cmd/compile: add reusable []Location to ssa.Config

name       old time/op      new time/op      delta
Template        218ms ± 3%       214ms ± 3%  -1.70%  (p=0.000 n=30+30)
Unicode         100ms ± 3%       100ms ± 4%    ~     (p=0.614 n=29+30)
GoTypes         657ms ± 1%       660ms ± 3%  +0.46%  (p=0.046 n=29+30)
Compiler        2.80s ± 2%       2.80s ± 1%    ~     (p=0.451 n=28+29)
Flate           131ms ± 2%       132ms ± 4%    ~     (p=1.000 n=29+29)
GoParser        159ms ± 3%       160ms ± 5%    ~     (p=0.341 n=28+30)
Reflect         406ms ± 3%       408ms ± 4%    ~     (p=0.511 n=28+30)
Tar             118ms ± 4%       118ms ± 4%    ~     (p=0.827 n=29+30)
XML             222ms ± 6%       222ms ± 3%    ~     (p=0.532 n=30+30)

name       old user-ns/op   new user-ns/op   delta
Template   274user-ms ± 3%  272user-ms ± 3%  -0.87%  (p=0.015 n=29+30)
Unicode    140user-ms ± 4%  140user-ms ± 3%    ~     (p=0.735 n=29+30)
GoTypes    890user-ms ± 1%  897user-ms ± 2%  +0.88%  (p=0.002 n=29+30)
Compiler   3.88user-s ± 2%  3.89user-s ± 1%    ~     (p=0.132 n=30+29)
Flate      168user-ms ± 2%  157user-ms ± 4%  -6.21%  (p=0.000 n=25+28)
GoParser   211user-ms ± 2%  213user-ms ± 5%    ~     (p=0.086 n=28+30)
Reflect    539user-ms ± 2%  541user-ms ± 3%    ~     (p=0.267 n=27+29)
Tar        156user-ms ± 7%  155user-ms ± 5%    ~     (p=0.708 n=30+30)
XML        291user-ms ± 5%  294user-ms ± 3%  +0.83%  (p=0.029 n=29+30)

name       old alloc/op     new alloc/op     delta
Template       40.7MB ± 0%      39.4MB ± 0%  -3.26%  (p=0.000 n=29+26)
Unicode        30.8MB ± 0%      30.7MB ± 0%  -0.40%  (p=0.000 n=28+30)
GoTypes         123MB ± 0%       119MB ± 0%  -3.47%  (p=0.000 n=30+29)
Compiler        472MB ± 0%       455MB ± 0%  -3.60%  (p=0.000 n=30+30)
Flate          26.5MB ± 0%      25.6MB ± 0%  -3.21%  (p=0.000 n=28+30)
GoParser       32.3MB ± 0%      31.4MB ± 0%  -2.98%  (p=0.000 n=29+30)
Reflect        84.4MB ± 0%      82.1MB ± 0%  -2.83%  (p=0.000 n=30+30)
Tar            27.3MB ± 0%      26.5MB ± 0%  -2.70%  (p=0.000 n=29+29)
XML            44.6MB ± 0%      43.1MB ± 0%  -3.49%  (p=0.000 n=30+30)

name       old allocs/op    new allocs/op    delta
Template         401k ± 1%        399k ± 0%  -0.35%  (p=0.000 n=30+28)
Unicode          331k ± 0%        331k ± 1%    ~     (p=0.907 n=28+30)
GoTypes         1.24M ± 0%       1.23M ± 0%  -0.43%  (p=0.000 n=30+30)
Compiler        4.26M ± 0%       4.25M ± 0%  -0.34%  (p=0.000 n=29+30)
Flate            252k ± 1%        251k ± 1%  -0.41%  (p=0.000 n=30+30)
GoParser         325k ± 1%        324k ± 1%  -0.31%  (p=0.000 n=27+30)
Reflect         1.06M ± 0%       1.05M ± 0%  -0.69%  (p=0.000 n=30+30)
Tar              266k ± 1%        265k ± 1%  -0.51%  (p=0.000 n=29+30)
XML              416k ± 1%        415k ± 1%  -0.36%  (p=0.002 n=30+30)

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

7 years agoruntime: skip flaky TestGdbPythonCgo on MIPS
Cherry Zhang [Thu, 2 Feb 2017 21:00:26 +0000 (16:00 -0500)]
runtime: skip flaky TestGdbPythonCgo on MIPS

It seems the problem is on gdb and the dynamic linker. Skip the
test for now until we figure out what's going on with the system.

Updates #18784.

Change-Id: Ic9320ffd463f6c231b2c4192652263b1cf7f4231
Reviewed-on: https://go-review.googlesource.com/36250
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agodoc: consistently link to the SettingGOPATH page
Jaana Burcu Dogan [Thu, 2 Feb 2017 19:39:02 +0000 (11:39 -0800)]
doc: consistently link to the SettingGOPATH page

Change-Id: I4fdd81aa7c9b180cb72ec4af3e7d9d803c99ecac
Reviewed-on: https://go-review.googlesource.com/36033
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/compile: simplify IsNonNil ConstNil
Cherry Zhang [Fri, 20 Jan 2017 17:14:22 +0000 (12:14 -0500)]
cmd/compile: simplify IsNonNil ConstNil

Change-Id: I9ed5a2065cef06708e319b16c801da2eff42004e
Reviewed-on: https://go-review.googlesource.com/35497
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agocmd/compile: remove nil check for Zero/Move on 386, AMD64, S390X
Cherry Zhang [Mon, 21 Nov 2016 16:31:39 +0000 (11:31 -0500)]
cmd/compile: remove nil check for Zero/Move on 386, AMD64, S390X

Fixes #18003.

Change-Id: Iadcc5c424c64badecfb5fdbd4dbd9197df56182c
Reviewed-on: https://go-review.googlesource.com/33421
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agocmd/compile: provide line number for cgo directive error (fix a TODO)
Robert Griesemer [Wed, 1 Feb 2017 23:17:32 +0000 (15:17 -0800)]
cmd/compile: provide line number for cgo directive error (fix a TODO)

Also: Remove double "go:" prefix in related error message.

Fixes #18882.

Change-Id: Ifbbd8e2f7529b43f035d3dbf7ca4a91f212bc6b6
Reviewed-on: https://go-review.googlesource.com/36121
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
7 years agoruntime: use mach_absolute_time for runtime.nanotime
Lars Wiegman [Tue, 17 Jan 2017 10:38:18 +0000 (11:38 +0100)]
runtime: use mach_absolute_time for runtime.nanotime

The existing darwin/amd64 implementation of runtime.nanotime returns the
wallclock time, which results in timers not functioning properly when
system time runs backwards. By implementing the algorithm used by the
darwin syscall mach_absolute_time, timers will function as expected.

The algorithm is described at
https://opensource.apple.com/source/xnu/xnu-3248.60.10/libsyscall/wrappers/mach_absolute_time.s

Fixes #17610

Change-Id: I9c8d35240d48249a6837dca1111b1406e2686f67
Reviewed-on: https://go-review.googlesource.com/35292
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/compile: skip convT2E for empty structs
Josh Bleecher Snyder [Sun, 22 Jan 2017 18:17:12 +0000 (10:17 -0800)]
cmd/compile: skip convT2E for empty structs

Fixes #18402

Change-Id: I5af800857fb2e365ce4224eece9171277106ec7d
Reviewed-on: https://go-review.googlesource.com/35562
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agocmd/compile: better implementation of Slicemask
Keith Randall [Tue, 24 Jan 2017 20:48:10 +0000 (12:48 -0800)]
cmd/compile: better implementation of Slicemask

Use (-x)>>63 instead of ((x-1)>>63)^-1 to get a mask that
is 0 when x is 0 and all ones when x is positive.

Saves one instruction when slicing.

Change-Id: Ib46d53d3aac6530ac481fa2f265a6eadf3df0567
Reviewed-on: https://go-review.googlesource.com/35641
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
7 years agocmd/compile, runtime: convert byte-sized values to interfaces without allocation
Josh Bleecher Snyder [Sun, 22 Jan 2017 03:52:09 +0000 (19:52 -0800)]
cmd/compile, runtime: convert byte-sized values to interfaces without allocation

Based in part on khr's CL 2500.

Updates #17725
Updates #18121

Change-Id: I744e1f92fc2104e6c5bd883a898c30b2eea8cc31
Reviewed-on: https://go-review.googlesource.com/35555
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agocmd/compile: convert constants to interfaces without allocating
Josh Bleecher Snyder [Sat, 21 Jan 2017 21:41:06 +0000 (13:41 -0800)]
cmd/compile: convert constants to interfaces without allocating

The order pass is responsible for ensuring that
values passed to runtime functions, including
convT2E/convT2I, are addressable.

Prior to this CL, this was always accomplished
by creating a temp, which frequently escaped to
the heap, causing allocations, perhaps most
notably in code like:

fmt.Println(1, 2, 3) // allocates three times

None of the runtime routines modify the contents
of the pointers they receive, so in the case of
constants, instead of creating a temp value,
we can create a static value.

(Marking the static value as read-only provides
protection against accidental attempts by the runtime
to modify the constant data.)

This improves code generation for code like:

panic("abc")
c <- 2 // c is a chan int

which can now simply refer to "abc" and 2,
rather than going by way of a temporary.

It also allows us to optimize convT2E/convT2I,
by recognizing static readonly values
and directly constructing the interface.

This CL adds ~0.5% to binary size, despite
decreasing the size of many functions,
because it also adds many static symbols.

This binary size regression could be recovered in
future (but currently unplanned) work.

There is a lot of content-duplication in these
symbols; this statement generates six new symbols,
three containing an int 1 and three containing
a pointer to the string "a":

fmt.Println(1, 1, 1, "a", "a", "a")

These symbols could be made content-addressable.

Furthermore, these symbols are small, so the
alignment and naming overhead is large.
As with the go.strings section, these symbols
could be hidden and have their alignment reduced.

The changes to test/live.go make it impossible
(at least with current optimization techniques)
to place the values being passed to the runtime
in static symbols, preserving autotmp creation.

Fixes #18704

Benchmarks from fmt and go-kit's logging package:

github.com/go-kit/kit/log

name                      old time/op    new time/op    delta
JSONLoggerSimple-8          1.91µs ± 2%    2.11µs ±22%     ~     (p=1.000 n=9+10)
JSONLoggerContextual-8      2.60µs ± 6%    2.43µs ± 2%   -6.29%  (p=0.000 n=9+10)
Discard-8                    101ns ± 2%      34ns ±14%  -66.33%  (p=0.000 n=10+9)
OneWith-8                    161ns ± 1%     102ns ±16%  -36.78%  (p=0.000 n=10+10)
TwoWith-8                    175ns ± 3%     106ns ± 7%  -39.36%  (p=0.000 n=10+9)
TenWith-8                    293ns ± 3%     227ns ±15%  -22.44%  (p=0.000 n=9+10)
LogfmtLoggerSimple-8         704ns ± 2%     608ns ± 2%  -13.65%  (p=0.000 n=10+9)
LogfmtLoggerContextual-8     962ns ± 1%     860ns ±17%  -10.57%  (p=0.003 n=9+10)
NopLoggerSimple-8            188ns ± 1%     120ns ± 1%  -36.39%  (p=0.000 n=9+10)
NopLoggerContextual-8        379ns ± 1%     243ns ± 0%  -35.77%  (p=0.000 n=9+10)
ValueBindingTimestamp-8      577ns ± 1%     499ns ± 1%  -13.51%  (p=0.000 n=10+10)
ValueBindingCaller-8         898ns ± 2%     844ns ± 2%   -6.00%  (p=0.000 n=10+10)

name                      old alloc/op   new alloc/op   delta
JSONLoggerSimple-8            904B ± 0%      872B ± 0%   -3.54%  (p=0.000 n=10+10)
JSONLoggerContextual-8      1.20kB ± 0%    1.14kB ± 0%   -5.33%  (p=0.000 n=10+10)
Discard-8                    64.0B ± 0%     32.0B ± 0%  -50.00%  (p=0.000 n=10+10)
OneWith-8                    96.0B ± 0%     64.0B ± 0%  -33.33%  (p=0.000 n=10+10)
TwoWith-8                     160B ± 0%      128B ± 0%  -20.00%  (p=0.000 n=10+10)
TenWith-8                     672B ± 0%      640B ± 0%   -4.76%  (p=0.000 n=10+10)
LogfmtLoggerSimple-8          128B ± 0%       96B ± 0%  -25.00%  (p=0.000 n=10+10)
LogfmtLoggerContextual-8      304B ± 0%      240B ± 0%  -21.05%  (p=0.000 n=10+10)
NopLoggerSimple-8             128B ± 0%       96B ± 0%  -25.00%  (p=0.000 n=10+10)
NopLoggerContextual-8         304B ± 0%      240B ± 0%  -21.05%  (p=0.000 n=10+10)
ValueBindingTimestamp-8       159B ± 0%      127B ± 0%  -20.13%  (p=0.000 n=10+10)
ValueBindingCaller-8          112B ± 0%       80B ± 0%  -28.57%  (p=0.000 n=10+10)

name                      old allocs/op  new allocs/op  delta
JSONLoggerSimple-8            19.0 ± 0%      17.0 ± 0%  -10.53%  (p=0.000 n=10+10)
JSONLoggerContextual-8        25.0 ± 0%      21.0 ± 0%  -16.00%  (p=0.000 n=10+10)
Discard-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
OneWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
TwoWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
TenWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
LogfmtLoggerSimple-8          4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
LogfmtLoggerContextual-8      7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
NopLoggerSimple-8             4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
NopLoggerContextual-8         7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
ValueBindingTimestamp-8       5.00 ± 0%      3.00 ± 0%  -40.00%  (p=0.000 n=10+10)
ValueBindingCaller-8          4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)

fmt

name                             old time/op    new time/op    delta
SprintfPadding-8                   88.9ns ± 3%    79.1ns ± 1%   -11.09%  (p=0.000 n=10+7)
SprintfEmpty-8                     12.6ns ± 3%    12.8ns ± 3%      ~     (p=0.136 n=10+10)
SprintfString-8                    38.7ns ± 5%    26.9ns ± 6%   -30.65%  (p=0.000 n=10+10)
SprintfTruncateString-8            56.7ns ± 2%    47.0ns ± 3%   -17.05%  (p=0.000 n=10+10)
SprintfQuoteString-8                164ns ± 2%     153ns ± 2%    -7.01%  (p=0.000 n=10+10)
SprintfInt-8                       38.9ns ±15%    26.5ns ± 2%   -31.93%  (p=0.000 n=10+9)
SprintfIntInt-8                    60.3ns ± 9%    38.2ns ± 1%   -36.67%  (p=0.000 n=10+8)
SprintfPrefixedInt-8               58.6ns ±13%    51.2ns ±11%   -12.66%  (p=0.001 n=10+10)
SprintfFloat-8                     71.4ns ± 3%    64.2ns ± 3%   -10.08%  (p=0.000 n=8+10)
SprintfComplex-8                    175ns ± 3%     159ns ± 2%    -9.03%  (p=0.000 n=10+10)
SprintfBoolean-8                   33.5ns ± 4%    25.7ns ± 5%   -23.28%  (p=0.000 n=10+10)
SprintfHexString-8                 65.3ns ± 3%    51.7ns ± 5%   -20.86%  (p=0.000 n=10+9)
SprintfHexBytes-8                  67.2ns ± 5%    67.9ns ± 4%      ~     (p=0.383 n=10+10)
SprintfBytes-8                      129ns ± 7%     124ns ± 7%      ~     (p=0.074 n=9+10)
SprintfStringer-8                   127ns ± 4%     126ns ± 8%      ~     (p=0.506 n=9+10)
SprintfStructure-8                  357ns ± 3%     359ns ± 3%      ~     (p=0.469 n=10+10)
ManyArgs-8                          203ns ± 6%     126ns ± 3%   -37.94%  (p=0.000 n=10+10)
FprintInt-8                         119ns ±10%      74ns ± 3%   -37.54%  (p=0.000 n=10+10)
FprintfBytes-8                      122ns ± 4%     120ns ± 3%      ~     (p=0.124 n=10+10)
FprintIntNoAlloc-8                 78.2ns ± 5%    74.1ns ± 3%    -5.28%  (p=0.000 n=10+10)
ScanInts-8                          349µs ± 1%     349µs ± 0%      ~     (p=0.606 n=9+8)
ScanRecursiveInt-8                 43.8ms ± 7%    40.1ms ± 2%    -8.42%  (p=0.000 n=10+10)
ScanRecursiveIntReaderWrapper-8    43.5ms ± 4%    40.4ms ± 2%    -7.16%  (p=0.000 n=10+9)

name                             old alloc/op   new alloc/op   delta
SprintfPadding-8                    24.0B ± 0%     16.0B ± 0%   -33.33%  (p=0.000 n=10+10)
SprintfEmpty-8                      0.00B          0.00B           ~     (all equal)
SprintfString-8                     21.0B ± 0%      5.0B ± 0%   -76.19%  (p=0.000 n=10+10)
SprintfTruncateString-8             32.0B ± 0%     16.0B ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfQuoteString-8                48.0B ± 0%     32.0B ± 0%   -33.33%  (p=0.000 n=10+10)
SprintfInt-8                        16.0B ± 0%      1.0B ± 0%   -93.75%  (p=0.000 n=10+10)
SprintfIntInt-8                     24.0B ± 0%      3.0B ± 0%   -87.50%  (p=0.000 n=10+10)
SprintfPrefixedInt-8                72.0B ± 0%     64.0B ± 0%   -11.11%  (p=0.000 n=10+10)
SprintfFloat-8                      16.0B ± 0%      8.0B ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfComplex-8                    48.0B ± 0%     32.0B ± 0%   -33.33%  (p=0.000 n=10+10)
SprintfBoolean-8                    8.00B ± 0%     4.00B ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfHexString-8                  96.0B ± 0%     80.0B ± 0%   -16.67%  (p=0.000 n=10+10)
SprintfHexBytes-8                    112B ± 0%      112B ± 0%      ~     (all equal)
SprintfBytes-8                      96.0B ± 0%     96.0B ± 0%      ~     (all equal)
SprintfStringer-8                   32.0B ± 0%     32.0B ± 0%      ~     (all equal)
SprintfStructure-8                   256B ± 0%      256B ± 0%      ~     (all equal)
ManyArgs-8                          80.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
FprintInt-8                         8.00B ± 0%     0.00B       -100.00%  (p=0.000 n=10+10)
FprintfBytes-8                      32.0B ± 0%     32.0B ± 0%      ~     (all equal)
FprintIntNoAlloc-8                  0.00B          0.00B           ~     (all equal)
ScanInts-8                         15.2kB ± 0%    15.2kB ± 0%      ~     (p=0.248 n=9+10)
ScanRecursiveInt-8                 21.6kB ± 0%    21.6kB ± 0%      ~     (all equal)
ScanRecursiveIntReaderWrapper-8    21.7kB ± 0%    21.7kB ± 0%      ~     (all equal)

name                             old allocs/op  new allocs/op  delta
SprintfPadding-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfEmpty-8                       0.00           0.00           ~     (all equal)
SprintfString-8                      2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfTruncateString-8              2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfQuoteString-8                 2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfInt-8                         2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfIntInt-8                      3.00 ± 0%      1.00 ± 0%   -66.67%  (p=0.000 n=10+10)
SprintfPrefixedInt-8                 2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfFloat-8                       2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfComplex-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfBoolean-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfHexString-8                   2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
SprintfHexBytes-8                    2.00 ± 0%      2.00 ± 0%      ~     (all equal)
SprintfBytes-8                       2.00 ± 0%      2.00 ± 0%      ~     (all equal)
SprintfStringer-8                    4.00 ± 0%      4.00 ± 0%      ~     (all equal)
SprintfStructure-8                   7.00 ± 0%      7.00 ± 0%      ~     (all equal)
ManyArgs-8                           8.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
FprintInt-8                          1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
FprintfBytes-8                       1.00 ± 0%      1.00 ± 0%      ~     (all equal)
FprintIntNoAlloc-8                   0.00           0.00           ~     (all equal)
ScanInts-8                          1.60k ± 0%     1.60k ± 0%      ~     (all equal)
ScanRecursiveInt-8                  1.71k ± 0%     1.71k ± 0%      ~     (all equal)
ScanRecursiveIntReaderWrapper-8     1.71k ± 0%     1.71k ± 0%      ~     (all equal)

Change-Id: I7ba72a25fea4140a0ba40a9f443103ed87cc69b5
Reviewed-on: https://go-review.googlesource.com/35554
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agoio: fix test when MultiReader is inlined with -l=3
David Lazar [Fri, 27 Jan 2017 20:24:48 +0000 (15:24 -0500)]
io: fix test when MultiReader is inlined with -l=3

This ensures there isn't a live reference to buf1 on our stack
when MultiReader is inlined.

Fixes #18819.

Change-Id: I96a8cdc1ffad8f8a10c0ddcbf0299005f3176b61
Reviewed-on: https://go-review.googlesource.com/35931
Run-TryBot: David Lazar <lazard@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agocmd/compile: reduce slice growth in fuseBlockPlain
Josh Bleecher Snyder [Wed, 11 Jan 2017 21:58:20 +0000 (13:58 -0800)]
cmd/compile: reduce slice growth in fuseBlockPlain

Instead of always appending to c.Values,
choose whichever slice is larger;
b.Values will be set to nil anyway.

Appending once instead of in a loop also
limits slice growth to once per function call
and is more efficient.

Reduces max rss for the program in #18602 by 6.5%,
and eliminates fuseBlockPlain from the alloc_space
pprof output. fuseBlockPlain previously accounted
for 16.74% of allocated memory.

Updates #18602.

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

7 years agocmd/compile: move rotate instruction generation to SSA
Keith Randall [Fri, 9 Dec 2016 00:17:20 +0000 (16:17 -0800)]
cmd/compile: move rotate instruction generation to SSA

Remove rotate generation from walk.  Remove OLROT and ssa.Lrot* opcodes.
Generate rotates during SSA lowering for architectures that have them.

This CL will allow rotates to be generated in more situations,
like when the shift values are determined to be constant
only after some analysis.

Fixes #18254

Change-Id: I8d6d684ff5ce2511aceaddfda98b908007851079
Reviewed-on: https://go-review.googlesource.com/34232
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
7 years agocmd/compile: allow inlining of functions with intrinsics in them
Keith Randall [Sat, 10 Dec 2016 00:59:38 +0000 (16:59 -0800)]
cmd/compile: allow inlining of functions with intrinsics in them

Intrinsics are ok to inline as they don't rewrite to actual calls.

Change-Id: Ieb19c834c61579823c62c6d1a1b425d6c4d4de23
Reviewed-on: https://go-review.googlesource.com/34272
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
7 years agocmd/compile: use len(s)<=cap(s) to remove more bounds checks
Keith Randall [Sun, 27 Nov 2016 19:43:08 +0000 (11:43 -0800)]
cmd/compile: use len(s)<=cap(s) to remove more bounds checks

When we discover a relation x <= len(s), also discover the relation
x <= cap(s).  That way, in situations like:

a := s[x:]  // tests 0 <= x <= len(s)
b := s[:x]  // tests 0 <= x <= cap(s)

the second check can be eliminated.

Fixes #16813

Change-Id: Ifc037920b6955e43bac1a1eaf6bac63a89cfbd44
Reviewed-on: https://go-review.googlesource.com/33633
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro>
Reviewed-by: David Chase <drchase@google.com>
7 years agocmd/compile: fix CSE with commutative ops
Keith Randall [Sun, 27 Nov 2016 18:41:37 +0000 (10:41 -0800)]
cmd/compile: fix CSE with commutative ops

CSE opportunities were being missed for commutative ops. We used to
order the args of commutative ops (by arg ID) once at the start of CSE.
But that may not be enough.

i1 = (Load ptr mem)
i2 = (Load ptr mem)
x1 = (Add i1 j)
x2 = (Add i2 j)

Equivalent commutative ops x1 and x2 may not get their args ordered in
the same way because because at the start of CSE, we don't know that
the i values will be CSEd. If x1 and x2 get opposite orders we won't
CSE them.

Instead, (re)order the args of commutative operations by their
equivalence class IDs each time we partition an equivalence class.

Change-Id: Ic609fa83b85299782a5e85bf93dc6023fccf4b0c
Reviewed-on: https://go-review.googlesource.com/33632
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
7 years agocmd/compile: improve error for wrong type in switch
Emmanuel Odeke [Sat, 14 Jan 2017 12:23:23 +0000 (05:23 -0700)]
cmd/compile: improve error for wrong type in switch

Fixes #10561.

Provides a better diagnostic message for failed type switch
satisfaction in the case that a value receiver is being used
in place of the pointer receiver that implements and satisfies
the interface.

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

7 years agocmd/cgo: don't track same node twice in guessKinds
Hiroshi Ioka [Thu, 2 Feb 2017 12:53:52 +0000 (21:53 +0900)]
cmd/cgo: don't track same node twice in guessKinds

Change-Id: Ib2c1490a42e3485913a05a0b2fecdcc425d42871
Reviewed-on: https://go-review.googlesource.com/36083
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agomisc/cgo/testshared: remove unused flag.Parse()
Daniel Martí [Sat, 26 Nov 2016 15:27:29 +0000 (15:27 +0000)]
misc/cgo/testshared: remove unused flag.Parse()

TestMain doesn't make use of any flags.

Change-Id: I98ec582fb004045a5067618f605ccfeb1f9f4bbb
Reviewed-on: https://go-review.googlesource.com/33613
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agomisc/ios: allow exit code 0 to mean test success
Elias Naur [Wed, 1 Feb 2017 17:41:27 +0000 (18:41 +0100)]
misc/ios: allow exit code 0 to mean test success

Tests that use TestMain might never call m.Run(), and simply return
from TestMain. In that case, the iOS test harness never sees the
PASS from the testing framework and assumes the test failed.

Allow an exit with exit code 0 to also mean test success, thereby
fixing the objdump test on iOS.

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

7 years agocmd/compile: improve error message if init is directly invoked
Emmanuel Odeke [Sun, 1 Jan 2017 10:08:48 +0000 (03:08 -0700)]
cmd/compile: improve error message if init is directly invoked

Fixes #8481.

Inform the user that init functions cannot be directly invoked
in user code, as mandated by the spec at:
http://golang.org/ref/spec#Program_initialization_and_execution.

Change-Id: Ib12c0c08718ffd48b76b6f9b13c76bb6612d2e7b
Reviewed-on: https://go-review.googlesource.com/34790
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/compile: intrinsify math.Sqrt by using only the ssa backend
Martin Möhrmann [Wed, 2 Nov 2016 16:20:22 +0000 (17:20 +0100)]
cmd/compile: intrinsify math.Sqrt by using only the ssa backend

Change-Id: If3cb64f52fe0fd7331b6f1acf3d15dd705dfd633
Reviewed-on: https://go-review.googlesource.com/32591
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
7 years agocmd/compile: fix conversion error message for printed slices
Emmanuel Odeke [Sat, 30 Jul 2016 08:45:27 +0000 (01:45 -0700)]
cmd/compile: fix conversion error message for printed slices

Fixes #15055.

Updates exprfmt printing using fmt verb "%v" to check that n.Left
is non-nil before attempting to print it, otherwise we'll print
the nodes in the list using verb "%.v".

Credit to @mdempsky for this approach and for finding
the root cause of the issue.

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

7 years agotest: add extra test for issue18661
Josh Bleecher Snyder [Sun, 22 Jan 2017 00:58:01 +0000 (16:58 -0800)]
test: add extra test for issue18661

Make sure that the lack of an lvalue doesn't
cause extra side-effects.

Updates #18661
Updates #18739

Change-Id: I52eb4b4a5c6f8ff5cddd2115455f853c18112c19
Reviewed-on: https://go-review.googlesource.com/36126
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
7 years agocmd/compile: skip reexporting types in reexportdep
Matthew Dempsky [Thu, 2 Feb 2017 00:40:46 +0000 (16:40 -0800)]
cmd/compile: skip reexporting types in reexportdep

The binary export format embeds type definitions inline as necessary,
so there's no need to add them to exportlist. Also, constants are
embedded directly by value, so they can be omitted too.

Change-Id: Id1879eb97c298a5a52f615cf9883c346c7f7bd69
Reviewed-on: https://go-review.googlesource.com/36170
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years agocmd/compile/internal/gc: add comment and test for #15550
Matthew Dempsky [Wed, 1 Feb 2017 23:13:48 +0000 (15:13 -0800)]
cmd/compile/internal/gc: add comment and test for #15550

When switching to the new parser, I changed cmd/compile to handle iota
per an intuitive interpretation of how nested constant declarations
should work (which also matches go/types).

Note: if we end up deciding that the current spec wording is
intentional (i.e., confirming gccgo's current behavior), the test will
need to be updated to expect 4 instead of 1.

Updates #15550.

Change-Id: I441f5f13209f172b73ef75031f2a9daa5e985277
Reviewed-on: https://go-review.googlesource.com/36122
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/link: assume that runtime.epclntab lives in .text section
Alex Brainman [Tue, 17 Jan 2017 04:06:12 +0000 (15:06 +1100)]
cmd/link: assume that runtime.epclntab lives in .text section

Sometimes STEXT symbols point to the first byte of .data
section, instead of the end of .text section. But, while writing
pe symbol table, we should treat them as if they belong to the
.text section. Change pe symbol table records for these symbols.

Fixes #14710

Change-Id: I1356e61aa8fa37d590d7b1677b2bac214ad0ba4e
Reviewed-on: https://go-review.googlesource.com/35272
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
7 years agocmd/compile: update maxPtrmaskBytes comment for larger value
Ian Lance Taylor [Wed, 1 Feb 2017 23:12:51 +0000 (15:12 -0800)]
cmd/compile: update maxPtrmaskBytes comment for larger value

The comment for maxPtrmaskBytes implied that the value was still 16,
but that changed in CL 10815.

Change-Id: I86e304bc7d9d1a0a6b22b600fefcc1325e4372d9
Reviewed-on: https://go-review.googlesource.com/36120
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
7 years agonet/http: detect Comcast et al DNS and auto-skip DNS tests
Kale Blankenship [Sun, 18 Dec 2016 04:40:29 +0000 (20:40 -0800)]
net/http: detect Comcast et al DNS and auto-skip DNS tests

Adds helper function to auto-skip tests when DNS returns
a successful response for a domain known not to exist.

The error from `net.LookupHost` is intentionally ignored
because the DNS tests will fail anyway if there are issues
unrelated to NXDOMAIN responses.

Fixes #17884

Change-Id: I729391bd702218507561818668f791331295299e
Reviewed-on: https://go-review.googlesource.com/34516
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/compile/internal/gc: inline typedcl0 and typedcl1
Matthew Dempsky [Wed, 1 Feb 2017 20:35:53 +0000 (12:35 -0800)]
cmd/compile/internal/gc: inline typedcl0 and typedcl1

It's easier to understand what's happening after inlining these into
noder.typeDecl.

Change-Id: I7beed5a1e18047bf09f2d4ddf64b9646c324d8d6
Reviewed-on: https://go-review.googlesource.com/36111
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
7 years agonet/http: make Server validate HTTP method
Michael Fraenkel [Thu, 15 Dec 2016 14:58:30 +0000 (09:58 -0500)]
net/http: make Server validate HTTP method

Fixes #18319

Change-Id: If88e60a86828f60d8d93fc291932c19bab19e8dc
Reviewed-on: https://go-review.googlesource.com/34470
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agomisc/ios: use the default go test timeout
Elias Naur [Wed, 1 Feb 2017 11:28:47 +0000 (12:28 +0100)]
misc/ios: use the default go test timeout

If -test.timeout is not specified to go test, it will time out after
a default 10 minutes.

The iOS exec wrapper also contains a fail safe timeout mechanism for
a stuck device. However, if no explicit -test.timeout is specified,
it will use a timeout of 0, plus some constant amount.

Use the same default timeout in the exec wrapper as for go test,
10 minutes.

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

7 years agosyscall: regenerate zsyscall_darwin_arm64.go with mksyscall.pl
Elias Naur [Wed, 1 Feb 2017 11:11:54 +0000 (12:11 +0100)]
syscall: regenerate zsyscall_darwin_arm64.go with mksyscall.pl

Notably, this change fixes the TestTCPReadWriteAllocs test because
the errnoErr wrapper is now used, elimitating the allocation for
common errnos.

The change to Dup is caused by a CL 8095 that changed the Dup* calls
to use Syscall instead of RawSyscall.

Found while working on the new iOS builders.

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

7 years agomisc/ios: include the bundle id in the GOIOS_APP_ID env variable
Elias Naur [Wed, 1 Feb 2017 08:37:47 +0000 (09:37 +0100)]
misc/ios: include the bundle id in the GOIOS_APP_ID env variable

The iOS exec wrapper use the constant bundle id "golang.gotest" for
running Go programs on iOS. However, that only happens to work on
the old iOS builders where their provisioning profile covers
that bundle id.

Expand the detection script to list all available provisioning
profiles for the attached device and include the bundle id in the
GOIOS_APP_ID environment variable.

To allow the old builders to continue, the "golang.gotest" bundle
id is used as a fallback if only the app id prefix is specified in
GOIOS_APP_ID.

For the new builders.

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

7 years agomisc/ios: ignore stderr from iOS tools
Elias Naur [Wed, 1 Feb 2017 07:57:46 +0000 (08:57 +0100)]
misc/ios: ignore stderr from iOS tools

On (at least) macOS 10.12, the `security cms` subcommand used by the
iOS detection script will output an error to stderr. The command
otherwise succeeds, but the extra line confuses a later parsing step.

To fix it, use only stdout and ignore stderr from every command run
by detect.go.

For the new iOS builders.

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

7 years agocrypto/tls: reject SNI values with a trailing dot.
Adam Langley [Mon, 5 Dec 2016 18:24:30 +0000 (10:24 -0800)]
crypto/tls: reject SNI values with a trailing dot.

SNI values may not include a trailing dot according to
https://tools.ietf.org/html/rfc6066#section-3. Although crypto/tls
handled this correctly as a client, it didn't reject this as a server.

This change makes sending an SNI value with a trailing dot a fatal
error.

Updates #18114.

Change-Id: Ib7897ab40e98d4a7a4646ff8469a55233621f631
Reviewed-on: https://go-review.googlesource.com/33904
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocrypto/x509: add test for v1 intermediates.
Adam Langley [Wed, 14 Dec 2016 22:10:26 +0000 (14:10 -0800)]
crypto/x509: add test for v1 intermediates.

X.509v1 certificates are ancient and should be dead. (They are even
prohibited by the Baseline requirements, section 7.1.1.)

However, there are a number of v1 roots from the 1990's that are still
in operation. Thus crypto/x509.Certificate.CheckSignatureFrom allows
X.509v1 certificates to sign other certificates.

The chain building code, however, only allows v1 certificates to sign
others if they're a root. This change adds a test to check that.

Change-Id: Ib8d81e522f30d41932b89bdf3b19ef3782d8ec12
Reviewed-on: https://go-review.googlesource.com/34383
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocrypto/tls: document ConnectionState.NegotiatedProtocol more clearly
Anmol Sethi [Sun, 29 Jan 2017 08:18:17 +0000 (03:18 -0500)]
crypto/tls: document ConnectionState.NegotiatedProtocol more clearly

ConnectionState.NegotiatedProtocol's documentation implies that it will
always be from Config.NextProtos. This commit clarifies that there is no
guarantee.

This commit also adds a note to
ConnectionState.NegotiatedProtocolIsMutual, making it clear that it is
client side only.

Fixes #18841

Change-Id: Icd028af8042f31e45575f1080c5e9bd3012e03d7
Reviewed-on: https://go-review.googlesource.com/35917
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agonet/http/httputil: eliminate duplicate alloc/copy in ReverseProxy
Blake Mizerany [Mon, 23 Jan 2017 19:03:03 +0000 (11:03 -0800)]
net/http/httputil: eliminate duplicate alloc/copy in ReverseProxy

This commit elimates the request allocation and shallow copy duplication
already done by req.WithContext.

name         old time/op    new time/op    delta
ServeHTTP-4     216µs ±36%     212µs ±15%     ~     (p=0.853 n=10+10)

name         old alloc/op   new alloc/op   delta
ServeHTTP-4     917kB ±36%    1137kB ± 0%     ~     (p=0.352 n=10+10)

name         old allocs/op  new allocs/op  delta
ServeHTTP-4      5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.000 n=10+10)

Change-Id: I514a59c30b037c7a65c355b06fd82c2d6ff17bb0
Reviewed-on: https://go-review.googlesource.com/35569
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agoimage/jpeg: improve performance when encoding *image.YCbCr
Thomas Bonfort [Sun, 1 Jan 2017 16:02:44 +0000 (17:02 +0100)]
image/jpeg: improve performance when encoding *image.YCbCr

The existing implementation falls back to using image.At()
for each pixel when encoding an *image.YCbCr which is
inefficient and causes many memory allocations.

This change makes the jpeg encoder directly read Y, Cb, and Cr
pixel values.

benchmark                  old ns/op     new ns/op     delta
BenchmarkEncodeYCbCr-4     43990846      24201148      -44.99%

benchmark                  old MB/s     new MB/s     speedup
BenchmarkEncodeYCbCr-4     20.95        38.08        1.82x

Fixes #18487

Change-Id: Iaf2ebc646997e3e1fffa5335f1b0d642e15bd453
Reviewed-on: https://go-review.googlesource.com/34773
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
7 years agodoc: mention SHA-256 CBC suites are off by default
Filippo Valsorda [Wed, 1 Feb 2017 19:57:11 +0000 (19:57 +0000)]
doc: mention SHA-256 CBC suites are off by default

Change-Id: I82c41bd1d82adda457ddb5dd08caf0647905da22
Reviewed-on: https://go-review.googlesource.com/36091
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agoRevert "testing: delete unused stopAlarm()"
Brad Fitzpatrick [Wed, 1 Feb 2017 21:23:03 +0000 (21:23 +0000)]
Revert "testing: delete unused stopAlarm()"

This reverts commit ed8c62b7fb47b717dc2adc9f6d0c90c924c67712.

Turns out it was needed in later commits.

Change-Id: I07a7bc2429976d8a5a89f915a11625c118b85500
Reviewed-on: https://go-review.googlesource.com/36113
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
7 years agocmd/compile: never report "truncated to real" for toint calls
Alberto Donizetti [Wed, 21 Dec 2016 10:07:11 +0000 (11:07 +0100)]
cmd/compile: never report "truncated to real" for toint calls

Whoever called toint() is expecting the {Mpint, Mpflt, Mpcplx} arg to
be converted to an integer expression, so it never makes sense to
report an error as "constant X truncated to real".

Fixes #11580

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

7 years agonet/http: remove check for null bytes in Dir.Open()
Anmol Sethi [Sun, 8 Jan 2017 19:46:54 +0000 (14:46 -0500)]
net/http: remove check for null bytes in Dir.Open()

The syscall package checks for null bytes now.
This was added in https://codereview.appspot.com/6458050

Change-Id: I59a2fed3757a25b85e2668905ff5cf2ec8c3a0d3
Reviewed-on: https://go-review.googlesource.com/34978
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agotime: defer loading ZONEINFO until first time.LoadLocation call
Jeff Johnson [Tue, 24 Jan 2017 19:45:20 +0000 (11:45 -0800)]
time: defer loading ZONEINFO until first time.LoadLocation call

A user application can now use os.Setenv("ZONEINFO", ..) becase the
value is no longer read on init of the time package.

Fixes #18619

Change-Id: Id8e303d67e6fb9c5d6ea9f969d8c94f6fff1bee3
Reviewed-on: https://go-review.googlesource.com/35639
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agotesting: delete unused stopAlarm()
Kyrylo Silin [Sun, 22 Jan 2017 15:56:03 +0000 (17:56 +0200)]
testing: delete unused stopAlarm()

The function call was removed in:
ead08e91f6468ab1c35c250ec487935103c580f6

Change-Id: I78fe563c9ea4554811c74130533d2186a65d3033
Reviewed-on: https://go-review.googlesource.com/35532
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agoarchive/zip: update the ZIP spec link
Ibrahim AshShohail [Sat, 21 Jan 2017 23:46:25 +0000 (02:46 +0300)]
archive/zip: update the ZIP spec link

Update the link to PKWARE "Application Notes on the .ZIP file format" document.
Now uses the permanent link according to 1.5 in version 6.3.3 (https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.3.TXT):
http://www.pkware.com/appnote

Fixes #18738

Change-Id: If252a5fca1dd666e70c2591a83d8714672d02932
Reviewed-on: https://go-review.googlesource.com/35500
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/pprof: remove redundant URLs from error messages in fetch.FetchURL
Ibrahim AshShohail [Tue, 24 Jan 2017 19:20:04 +0000 (22:20 +0300)]
cmd/pprof: remove redundant URLs from error messages in fetch.FetchURL

Errors from http.Client already includes the URL in the message.

Fixes #18754

Change-Id: I65fc25a8f3aa6a2d4627aac3fb47eed8d3c4151a
Reviewed-on: https://go-review.googlesource.com/35650
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agomime/multipart: allow boundary len <= 70
Patrick Pelletier [Thu, 26 Jan 2017 06:09:26 +0000 (22:09 -0800)]
mime/multipart: allow boundary len <= 70

As per RFC 2046, the boundary for multipart MIME is allowed up to 70
characters. The old SetBoundary implementation only allowed up to 69 so
this bumps it to the correct value of 70.

The relevant RFC is at https://www.ietf.org/rfc/rfc2046.txt and section
5.1.1 defines the boundary specification.

Fixes #18793

Change-Id: I91d2ed4549c3d27d6049cb473bac680a750fb520
Reviewed-on: https://go-review.googlesource.com/35830
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agodatabase/sql: fix spelling mistake
Kevin Burke [Thu, 26 Jan 2017 21:41:56 +0000 (13:41 -0800)]
database/sql: fix spelling mistake

Change-Id: I67db3b342929a7bd11f01bf3b9afb49f4da69a0a
Reviewed-on: https://go-review.googlesource.com/35841
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/compile: report more non-inlineable functions
Josh Bleecher Snyder [Wed, 9 Nov 2016 06:18:38 +0000 (22:18 -0800)]
cmd/compile: report more non-inlineable functions

Many non-inlineable functions were not being
reported in '-m -m' mode.

Updates #17858.

Change-Id: I7d96361b39dd317f5550e57334a8a6dd1a836598
Reviewed-on: https://go-review.googlesource.com/32971
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
7 years agocmd/compile: fix generic.rules
Michael Munday [Wed, 1 Feb 2017 19:40:58 +0000 (14:40 -0500)]
cmd/compile: fix generic.rules

generic.rules wasn't updated when rewritegeneric.go was. This commit
updates it so that the rewritegeneric.go file can be regenerated.

Fixes #18885.

Change-Id: Ie7dab653ca0a9ea1c255fd12e311a0d9e66afdd2
Reviewed-on: https://go-review.googlesource.com/36032
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
7 years agocmd/compile: allocate Nodes together with Name/Param/Func
Matthew Dempsky [Tue, 31 Jan 2017 22:32:11 +0000 (14:32 -0800)]
cmd/compile: allocate Nodes together with Name/Param/Func

After allocating a Node that needs a Name, Param, and/or Func field,
we never clear that field, so we can reduce GC overhead slightly by
allocating them together with the owner Node.

name       old time/op     new time/op     delta
Template       325ms ± 7%      325ms ± 7%    ~           (p=0.910 n=29+30)
Unicode        177ms ±12%      173ms ±11%    ~           (p=0.110 n=29+30)
GoTypes        1.06s ± 7%      1.05s ± 5%  -1.22%        (p=0.027 n=30+30)
Compiler       4.48s ± 3%      4.47s ± 3%    ~           (p=0.423 n=30+30)

name       old user-ns/op  new user-ns/op  delta
Template        476M ±22%       467M ±14%    ~           (p=0.310 n=29+30)
Unicode         298M ±22%       294M ±25%    ~           (p=0.335 n=30+30)
GoTypes        1.54G ± 9%      1.48G ± 9%  -4.06%        (p=0.000 n=30+30)
Compiler       6.26G ± 6%      6.14G ± 6%  -1.90%        (p=0.004 n=30+30)

name       old alloc/op    new alloc/op    delta
Template      40.9MB ± 0%     41.1MB ± 0%  +0.53%        (p=0.000 n=30+30)
Unicode       30.9MB ± 0%     31.0MB ± 0%  +0.16%        (p=0.000 n=30+30)
GoTypes        122MB ± 0%      123MB ± 0%  +0.37%        (p=0.000 n=30+30)
Compiler       477MB ± 0%      479MB ± 0%  +0.37%        (p=0.000 n=30+29)

name       old allocs/op   new allocs/op   delta
Template        400k ± 1%       376k ± 1%  -5.96%        (p=0.000 n=30+30)
Unicode         330k ± 1%       325k ± 1%  -1.48%        (p=0.000 n=30+30)
GoTypes        1.22M ± 0%      1.16M ± 0%  -4.38%        (p=0.000 n=30+30)
Compiler       4.35M ± 0%      4.13M ± 0%  -5.08%        (p=0.000 n=30+29)

Change-Id: I9bdc7d9223bb32f785df71810564e82d9a76d109
Reviewed-on: https://go-review.googlesource.com/36022
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/compile: simplify noding const declarations
Matthew Dempsky [Wed, 1 Feb 2017 00:31:11 +0000 (16:31 -0800)]
cmd/compile: simplify noding const declarations

By grouping all the logic into constDecl, we're able to get rid of the
lastconst and lasttype globals, and simplify the logic slightly. Still
clunky, but much easier to reason about.

Change-Id: I446696c31084b3bfc1fd5d3651655a81ddd159ab
Reviewed-on: https://go-review.googlesource.com/36023
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agocmd/compile: insertVarPhis micro-optimization
Josh Bleecher Snyder [Wed, 16 Nov 2016 06:33:10 +0000 (22:33 -0800)]
cmd/compile: insertVarPhis micro-optimization

Algorithmic improvements here are hard.
Lifting a lookup out of the loop helps a little, though.

To compile the code in #17926:

name  old s/op   new s/op   delta
Real   146 ± 3%   140 ± 4%  -3.87%  (p=0.002 n=10+10)
User   143 ± 3%   139 ± 4%  -3.08%  (p=0.005 n=10+10)
Sys   8.28 ±35%  8.08 ±28%    ~     (p=0.684 n=10+10)

Updates #17926.

Change-Id: Ic255ac8b7b409c1a53791058818b7e2cf574abe3
Reviewed-on: https://go-review.googlesource.com/33305
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
7 years agocmd/compile: disable memory profiling when not in use
Josh Bleecher Snyder [Fri, 27 Jan 2017 22:04:23 +0000 (14:04 -0800)]
cmd/compile: disable memory profiling when not in use

The default value of runtime.MemProfileRate
is non-zero, which means that a small portion
of allocations go through the (slow) profiled
allocation path.

This is never useful in the compiler
unless the -memprofile flag has been passed.
I noticed this when samples from mprof.go
showed up in a compiler cpu pprof listing.

name       old time/op      new time/op      delta
Template        207ms ± 4%       205ms ± 4%  -0.86%  (p=0.001 n=97+90)
Unicode        91.8ms ± 4%      91.4ms ± 4%  -0.44%  (p=0.030 n=93+93)
GoTypes         628ms ± 4%       624ms ± 3%  -0.73%  (p=0.001 n=95+92)
Compiler        2.70s ± 3%       2.69s ± 3%  -0.39%  (p=0.000 n=97+95)
Flate           131ms ± 5%       130ms ± 4%  -0.82%  (p=0.000 n=93+90)
GoParser        154ms ± 5%       153ms ± 4%  -0.57%  (p=0.019 n=98+96)
Reflect         394ms ± 5%       392ms ± 5%  -0.62%  (p=0.026 n=94+97)
Tar             112ms ± 6%       112ms ± 5%    ~     (p=0.455 n=97+98)
XML             214ms ± 3%       213ms ± 4%  -0.68%  (p=0.000 n=91+93)

name       old user-ns/op   new user-ns/op   delta
Template   246user-ms ± 3%  244user-ms ± 4%  -0.48%  (p=0.016 n=92+91)
Unicode    114user-ms ± 5%  113user-ms ± 4%  -0.78%  (p=0.002 n=98+94)
GoTypes    817user-ms ± 3%  813user-ms ± 2%  -0.50%  (p=0.006 n=96+94)
Compiler   3.58user-s ± 2%  3.57user-s ± 2%  -0.38%  (p=0.003 n=97+95)
Flate      158user-ms ± 5%  157user-ms ± 4%  -0.80%  (p=0.000 n=94+90)
GoParser   191user-ms ± 4%  191user-ms ± 4%    ~     (p=0.122 n=98+98)
Reflect    500user-ms ± 4%  498user-ms ± 4%    ~     (p=0.057 n=95+99)
Tar        134user-ms ± 3%  134user-ms ± 4%    ~     (p=0.529 n=98+98)
XML        265user-ms ± 3%  265user-ms ± 3%  -0.30%  (p=0.033 n=92+96)

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

7 years agocmd/compile: eliminate iota_
Matthew Dempsky [Mon, 31 Oct 2016 23:20:42 +0000 (16:20 -0700)]
cmd/compile: eliminate iota_

Change-Id: Iad9c1961aedcc754ad2f6010a49f94c5a0a4bfee
Reviewed-on: https://go-review.googlesource.com/32487
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
7 years agocontext: lazily initialize cancelCtx done channel
Josh Bleecher Snyder [Sun, 8 Jan 2017 21:22:24 +0000 (13:22 -0800)]
context: lazily initialize cancelCtx done channel

This CL reduces allocations when a context
created with WithCancel either

(1) never has its Done channel used or
(2) gets cancelled before its Done channel is used

This is not uncommon. Many contexts are created
for tasks that end up not using them.

name                                                old time/op    new time/op    delta
ContextCancelTree/depth=1/Root=Background-8            112ns ± 2%      74ns ± 1%  -34.03%  (p=0.000 n=17+18)
ContextCancelTree/depth=1/Root=OpenCanceler-8          601ns ± 3%     544ns ± 1%   -9.56%  (p=0.000 n=20+20)
ContextCancelTree/depth=1/Root=ClosedCanceler-8        367ns ± 4%     257ns ± 1%  -30.01%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=Background-8          2.91µs ± 2%    2.87µs ± 0%   -1.38%  (p=0.000 n=20+18)
ContextCancelTree/depth=10/Root=OpenCanceler-8        4.36µs ± 2%    4.26µs ± 1%   -2.34%  (p=0.000 n=20+18)
ContextCancelTree/depth=10/Root=ClosedCanceler-8      2.02µs ± 2%    1.51µs ± 1%  -25.18%  (p=0.000 n=19+19)
ContextCancelTree/depth=100/Root=Background-8         30.5µs ± 6%    30.5µs ± 1%     ~     (p=0.941 n=20+20)
ContextCancelTree/depth=100/Root=OpenCanceler-8       39.8µs ± 1%    41.1µs ± 1%   +3.15%  (p=0.000 n=18+19)
ContextCancelTree/depth=100/Root=ClosedCanceler-8     17.8µs ± 1%    13.9µs ± 1%  -21.61%  (p=0.000 n=18+20)
ContextCancelTree/depth=1000/Root=Background-8         302µs ± 1%     313µs ± 0%   +3.62%  (p=0.000 n=20+18)
ContextCancelTree/depth=1000/Root=OpenCanceler-8       412µs ± 2%     427µs ± 1%   +3.55%  (p=0.000 n=18+19)
ContextCancelTree/depth=1000/Root=ClosedCanceler-8     178µs ± 1%     139µs ± 1%  -21.80%  (p=0.000 n=19+17)

name                                                old alloc/op   new alloc/op   delta
ContextCancelTree/depth=1/Root=Background-8             176B ± 0%       80B ± 0%  -54.55%  (p=0.000 n=20+20)
ContextCancelTree/depth=1/Root=OpenCanceler-8           544B ± 0%      448B ± 0%  -17.65%  (p=0.000 n=20+20)
ContextCancelTree/depth=1/Root=ClosedCanceler-8         352B ± 0%      160B ± 0%  -54.55%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=Background-8          3.49kB ± 0%    3.39kB ± 0%   -2.75%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=OpenCanceler-8        3.86kB ± 0%    3.76kB ± 0%   -2.49%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=ClosedCanceler-8      1.94kB ± 0%    0.88kB ± 0%  -54.55%  (p=0.000 n=20+20)
ContextCancelTree/depth=100/Root=Background-8         36.6kB ± 0%    36.5kB ± 0%   -0.26%  (p=0.000 n=20+20)
ContextCancelTree/depth=100/Root=OpenCanceler-8       37.0kB ± 0%    36.9kB ± 0%   -0.26%  (p=0.000 n=20+20)
ContextCancelTree/depth=100/Root=ClosedCanceler-8     17.8kB ± 0%     8.1kB ± 0%  -54.55%  (p=0.000 n=20+20)
ContextCancelTree/depth=1000/Root=Background-8         368kB ± 0%     368kB ± 0%   -0.03%  (p=0.000 n=20+20)
ContextCancelTree/depth=1000/Root=OpenCanceler-8       368kB ± 0%     368kB ± 0%   -0.03%  (p=0.000 n=20+20)
ContextCancelTree/depth=1000/Root=ClosedCanceler-8     176kB ± 0%      80kB ± 0%  -54.55%  (p=0.000 n=20+20)

name                                                old allocs/op  new allocs/op  delta
ContextCancelTree/depth=1/Root=Background-8             3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.000 n=20+20)
ContextCancelTree/depth=1/Root=OpenCanceler-8           8.00 ± 0%      7.00 ± 0%  -12.50%  (p=0.000 n=20+20)
ContextCancelTree/depth=1/Root=ClosedCanceler-8         6.00 ± 0%      4.00 ± 0%  -33.33%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=Background-8            48.0 ± 0%      47.0 ± 0%   -2.08%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=OpenCanceler-8          53.0 ± 0%      52.0 ± 0%   -1.89%  (p=0.000 n=20+20)
ContextCancelTree/depth=10/Root=ClosedCanceler-8        33.0 ± 0%      22.0 ± 0%  -33.33%  (p=0.000 n=20+20)
ContextCancelTree/depth=100/Root=Background-8            498 ± 0%       497 ± 0%   -0.20%  (p=0.000 n=20+20)
ContextCancelTree/depth=100/Root=OpenCanceler-8          503 ± 0%       502 ± 0%   -0.20%  (p=0.000 n=20+20)
ContextCancelTree/depth=100/Root=ClosedCanceler-8        303 ± 0%       202 ± 0%  -33.33%  (p=0.000 n=20+20)
ContextCancelTree/depth=1000/Root=Background-8         5.00k ± 0%     5.00k ± 0%   -0.02%  (p=0.000 n=20+20)
ContextCancelTree/depth=1000/Root=OpenCanceler-8       5.00k ± 0%     5.00k ± 0%   -0.02%  (p=0.000 n=20+20)
ContextCancelTree/depth=1000/Root=ClosedCanceler-8     3.00k ± 0%     2.00k ± 0%  -33.33%  (p=0.000 n=20+20)

Change-Id: Ibd7a0c3d5c847861cf1497f8fead34329413d26d
Reviewed-on: https://go-review.googlesource.com/34979
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Sameer Ajmani <sameer@golang.org>
7 years agocmd/asm, cmd/internal/obj/s390x: fix encoding of VREPI{H,F,G}
Michael Munday [Sun, 22 Jan 2017 17:12:22 +0000 (12:12 -0500)]
cmd/asm, cmd/internal/obj/s390x: fix encoding of VREPI{H,F,G}

Also adds tests for all missing VRI-a instructions (which may be
affected by this change).

Fixes #18749.

Change-Id: I48249dda626f32555da9ab58659e2e140de6504a
Reviewed-on: https://go-review.googlesource.com/35561
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
7 years agotesting: synchronize writes to the root's Writer
Joe Tsai [Sun, 22 Jan 2017 04:07:26 +0000 (20:07 -0800)]
testing: synchronize writes to the root's Writer

Prior to this change it was possible to see interleaved messages:
<<<
=== RUN   Test/LongLongLongLongName48
=== RUN   Test/LongLon=== RUN   Test/LongLongLongLongName50
gLongLongName49
=== RUN   Test/LongLongLongLongName51
>>>

This change fixes it such that you see:
<<<
=== RUN   Test/LongLongLongLongName48
=== RUN   Test/LongLongLongLongName49
=== RUN   Test/LongLongLongLongName50
=== RUN   Test/LongLongLongLongName51
>>>

Fixes #18741

Change-Id: I2529d724065dc65b3e9eb3d7cbeeda82a2d0cfd4
Reviewed-on: https://go-review.googlesource.com/35556
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>

7 years agoreflect: adjust documentation on Value
Joe Tsai [Tue, 31 Jan 2017 20:54:45 +0000 (12:54 -0800)]
reflect: adjust documentation on Value

Make the documentation more explicit that it is not safe to directly
compare Value. Get straight to the point on how to do it correctly.

Updates #18871

Change-Id: I2aa3253f779636b2f72a1aae8c9bb45d3c32c902
Reviewed-on: https://go-review.googlesource.com/36018
Reviewed-by: Keith Randall <khr@golang.org>
7 years agoall: merge dev.inline into master
Russ Cox [Wed, 1 Feb 2017 14:35:27 +0000 (09:35 -0500)]
all: merge dev.inline into master

Change-Id: I7715581a04e513dcda9918e853fa6b1ddc703770

7 years agoall: merge dev.typealias into master
Russ Cox [Tue, 31 Jan 2017 17:57:12 +0000 (12:57 -0500)]
all: merge dev.typealias into master

For #18130.

f8b4123613 [dev.typealias] spec: use term 'embedded field' rather than 'anonymous field'
9ecc3ee252 [dev.typealias] cmd/compile: avoid false positive cycles from type aliases
49b7af8a30 [dev.typealias] reflect: add test for type aliases
9bbb07ddec [dev.typealias] cmd/compile, reflect: fix struct field names for embedded byte, rune
43c7094386 [dev.typealias] reflect: fix StructOf use of StructField to match StructField docs
9657e0b077 [dev.typealias] cmd/doc: update for type alias
de2e5459ae [dev.typealias] cmd/compile: declare methods after resolving receiver type
9259f3073a [dev.typealias] test: match gccgo error messages on alias2.go
5d92916770 [dev.typealias] cmd/compile: change Func.Shortname to *Sym
a7c884efc1 [dev.typealias] go/internal/gccgoimporter: support for type aliases
5802cfd900 [dev.typealias] cmd/compile: export/import test cases for type aliases
d7cabd40dd [dev.typealias] go/types: clarified doc string
cc2dcce3d7 [dev.typealias] cmd/compile: a few better comments related to alias types
5c160b28ba [dev.typealias] cmd/compile: improved error message for cyles involving type aliases
b2386dffa1 [dev.typealias] cmd/compile: type-check type alias declarations
ac8421f9a5 [dev.typealias] cmd/compile: various minor cleanups
f011e0c6c3 [dev.typealias] cmd/compile, go/types, go/importer: various alias related fixes
49de5f0351 [dev.typealias] cmd/compile, go/importer: define export format and implement importing of type aliases
5ceec42dc0 [dev.typealias] go/types: export TypeName.IsAlias so clients can use it
aa1f0681bc [dev.typealias] go/types: improved Object printing
c80748e389 [dev.typealias] go/types: remove some more vestiges of prior alias implementation
80d8b69e95 [dev.typealias] go/types: implement type aliases
a917097b5e [dev.typealias] go/build: add go1.9 build tag
3e11940437 [dev.typealias] cmd/compile: recognize type aliases but complain for now (not yet supported)
e0a05c274a [dev.typealias] cmd/gofmt: added test cases for alias type declarations
2e5116bd99 [dev.typealias] go/ast, go/parser, go/printer, go/types: initial type alias support

Change-Id: Ia65f2e011fd7195f18e1dce67d4d49b80a261203

7 years agotesting: stop timeout-timer after running tests
Alberto Donizetti [Sun, 29 Jan 2017 19:53:35 +0000 (20:53 +0100)]
testing: stop timeout-timer after running tests

Fixes #18845

Change-Id: Icdc3e2067807781e42f2ffc94d1824aed94d3713
Reviewed-on: https://go-review.googlesource.com/35956
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years ago[dev.typealias] spec: use term 'embedded field' rather than 'anonymous field'
Robert Griesemer [Wed, 11 Jan 2017 00:19:14 +0000 (16:19 -0800)]
[dev.typealias] spec: use term 'embedded field' rather than 'anonymous field'

First steps towards defining type aliases in the spec.
This is a nomenclature clarification, not a language change.

The spec used all three terms 'embedded type', 'anonymous field',
and 'embedded field'. Users where using the terms inconsistently.

The notion of an 'anonymous' field was always misleading since they
always had a de-facto name. With type aliases that name becomes even
more important because we may have different names for the same type.

Use the term 'embedded field' consistently and remove competing
terminology.

For #18130.

Change-Id: I2083bbc85788cab0b2e2cb1ff58b2f979491f001
Reviewed-on: https://go-review.googlesource.com/35108
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
7 years agocmd/dist: really skip the testsanitizers tests on Android
Elias Naur [Mon, 30 Jan 2017 18:55:35 +0000 (19:55 +0100)]
cmd/dist: really skip the testsanitizers tests on Android

The test.bash script in misc/cgo/testsanitizers use GOOS, not GOHOSTOS.
Fix the dist check from gohostos to goos accordingly.

The error was masked on the builders because they run on a darwin host
where the sanitizers tests never ran.

With this change, the Android test suite completes successfully on
Android/amd64.

Change-Id: Id7690429f78c6ac7a26fc9118d913b719b565bb2
Reviewed-on: https://go-review.googlesource.com/35959
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years agoruntime: add explicit (void) in C to avoid GCC 7 problem
Ian Lance Taylor [Mon, 30 Jan 2017 17:43:25 +0000 (09:43 -0800)]
runtime: add explicit (void) in C to avoid GCC 7 problem

This avoids errors like
    ./traceback.go:80:2: call of non-function C.f1

I filed https://gcc.gnu.org/PR79289 for the GCC problem. I think this
is a bug in GCC, and it may be fixed before the final GCC 7 release.
This CL is correct either way.

Fixes #18855.

Change-Id: I0785a7b7c5b1d0ca87b454b5eca9079f390fcbd4
Reviewed-on: https://go-review.googlesource.com/35919
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
7 years agocmd/dist: use the target GOOS to skip the test for issue 18153
Elias Naur [Sun, 29 Jan 2017 22:57:14 +0000 (23:57 +0100)]
cmd/dist: use the target GOOS to skip the test for issue 18153

Fixes (skips) the test on Android, where stdout/stderr are not
terminals.

Updates #18153

Change-Id: Ieca65150362a5c423747ad751e00f76f0b890746
Reviewed-on: https://go-review.googlesource.com/35957
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: update go1.8 release notes after TxOptions change
Daniel Theophanes [Sat, 28 Jan 2017 15:36:09 +0000 (07:36 -0800)]
doc: update go1.8 release notes after TxOptions change

Missed the release notes when updating the sql API.

Fixes #18825

Change-Id: I89056d46939ad4fc99590f3434d2881f5764e1b6
Reviewed-on: https://go-review.googlesource.com/35915
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/go: update alldocs after CL 35150
Alberto Donizetti [Sat, 28 Jan 2017 10:56:15 +0000 (11:56 +0100)]
cmd/go: update alldocs after CL 35150

Author of CL 35150 forgot to run mkalldocs.sh to update
the autogenerated alldocs.go

Change-Id: Ib824562db6044702456a221a8c6f9af412927a98
Reviewed-on: https://go-review.googlesource.com/35952
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/compile: use CMPWU for 32-bit or smaller unsigned Geq on ppc64{,le}
Michael Munday [Fri, 27 Jan 2017 04:31:28 +0000 (23:31 -0500)]
cmd/compile: use CMPWU for 32-bit or smaller unsigned Geq on ppc64{,le}

Fixes #18808.

Change-Id: I49b266380b9d6804c9f6563ebac9c7c0e05f37f6
Reviewed-on: https://go-review.googlesource.com/35890
Run-TryBot: Michael Munday <munday@ca.ibm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
7 years ago[dev.typealias] cmd/compile: avoid false positive cycles from type aliases
Matthew Dempsky [Thu, 26 Jan 2017 17:00:56 +0000 (09:00 -0800)]
[dev.typealias] cmd/compile: avoid false positive cycles from type aliases

For #18130.
Fixes #18640.

Change-Id: I26cf1d1b78cca6ef207cc4333f30a9011ef347c9
Reviewed-on: https://go-review.googlesource.com/35831
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years agodoc: document go1.7.5
Chris Broadfoot [Thu, 26 Jan 2017 17:30:04 +0000 (09:30 -0800)]
doc: document go1.7.5

Change-Id: Ic8d4e971edebba9412f2e7c3d3c29f296c4977ff
Reviewed-on: https://go-review.googlesource.com/35833
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/go: don't reject ./... matching top-level file outside GOPATH
Ian Lance Taylor [Wed, 25 Jan 2017 14:25:17 +0000 (06:25 -0800)]
cmd/go: don't reject ./... matching top-level file outside GOPATH

This unwinds a small part of CL 31668: we now accept "./." in cleanImport.

Fixes #18778.

Change-Id: Ia7f1fde1cafcea3cc9e0b597a95a0e0bb410a3ed
Reviewed-on: https://go-review.googlesource.com/35646
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
7 years agodatabase/sql: fix race when canceling queries immediately
Daniel Theophanes [Sat, 21 Jan 2017 01:12:50 +0000 (17:12 -0800)]
database/sql: fix race when canceling queries immediately

Previously the following could happen, though in practice it would
be rare.

Goroutine 1:
(*Tx).QueryContext begins a query, passing in userContext

Goroutine 2:
(*Tx).awaitDone starts to wait on the context derived from the passed in context

Goroutine 1:
(*Tx).grabConn returns a valid (*driverConn)
The (*driverConn) passes to (*DB).queryConn

Goroutine 3:
userContext is canceled

Goroutine 2:
(*Tx).awaitDone unblocks and calls (*Tx).rollback
(*driverConn).finalClose obtains dc.Mutex
(*driverConn).finalClose sets dc.ci = nil

Goroutine 1:
(*DB).queryConn obtains dc.Mutex in withLock
ctxDriverPrepare accepts dc.ci which is now nil
ctxCriverPrepare panics on the nil ci

The fix for this is to guard the Tx methods with a RWLock
holding it exclusivly when closing the Tx and holding a read lock
when executing a query.

Fixes #18719

Change-Id: I37aa02c37083c9793dabd28f7f934a1c5cbc05ea
Reviewed-on: https://go-review.googlesource.com/35550
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agogo/printer: fix format with leading comments in composite literal
Robert Griesemer [Wed, 25 Jan 2017 23:05:39 +0000 (15:05 -0800)]
go/printer: fix format with leading comments in composite literal

This fix is less pervasive than it seems. The only change affecting
formatting is on printer.go:760. The remaining changes have no effect
on formatting since the value of p.level is ignored except on this
specific line.

The remaining changes are:
- renamed adjBlock to funcBody since that's how it is used
- introduced new printer field 'level' tracking the composite
  literal nesting level
- update/restore the composite literal nesting level as needed

Fixes #18782.

Change-Id: Ie833a9b5a559c4ec0f2eef2c5dc97aa263dca53a
Reviewed-on: https://go-review.googlesource.com/35811
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agoruntime: reorder modules so main.main comes first
David Crawshaw [Wed, 25 Jan 2017 04:19:36 +0000 (20:19 -0800)]
runtime: reorder modules so main.main comes first

Modules appear in the moduledata linked list in the order they are
loaded by the dynamic loader, with one exception: the
firstmoduledata itself the module that contains the runtime.
This is not always the first module (when using -buildmode=shared,
it is typically libstd.so, the second module).

The order matters for typelinksinit, so we swap the first module
with whatever module contains the main function.

Updates #18729

This fixes the test case extracted with -linkshared, and now

go test -linkshared encoding/...

passes. However the original issue about a plugin failure is not
yet fixed.

Change-Id: I9f399ecc3518e22e6b0a350358e90b0baa44ac96
Reviewed-on: https://go-review.googlesource.com/35644
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years agodatabase/sql: let tests wait for db pool to come to expected state
Daniel Theophanes [Wed, 25 Jan 2017 16:27:45 +0000 (08:27 -0800)]
database/sql: let tests wait for db pool to come to expected state

Slower builders were failing TestQueryContext because the cancel
and return to conn pool happens async. TestQueryContext already
uses a wait method for this reason. Use the same method for
other context tests.

Fixes #18759

Change-Id: I84cce697392b867e4ebdfadd38027a06ca14655f
Reviewed-on: https://go-review.googlesource.com/35750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

7 years ago[dev.typealias] reflect: add test for type aliases
Russ Cox [Tue, 24 Jan 2017 19:59:22 +0000 (14:59 -0500)]
[dev.typealias] reflect: add test for type aliases

For #18130.

Change-Id: Idd77cb391178c185227cfd779c70fec16351f825
Reviewed-on: https://go-review.googlesource.com/35733
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 years ago[dev.typealias] cmd/compile, reflect: fix struct field names for embedded byte, rune
Russ Cox [Wed, 25 Jan 2017 15:19:33 +0000 (10:19 -0500)]
[dev.typealias] cmd/compile, reflect: fix struct field names for embedded byte, rune

Will also fix type aliases.

Fixes #17766.
For #18130.

Change-Id: I9e1584d47128782152e06abd0a30ef423d5c30d2
Reviewed-on: https://go-review.googlesource.com/35732
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years ago[dev.typealias] reflect: fix StructOf use of StructField to match StructField docs
Russ Cox [Wed, 25 Jan 2017 14:50:36 +0000 (09:50 -0500)]
[dev.typealias] reflect: fix StructOf use of StructField to match StructField docs

The runtime internal structField interprets name=="" as meaning anonymous,
but the exported reflect.StructField has always set Name, even for anonymous
fields, and also set Anonymous=true.

The initial implementation of StructOf confused the internal and public
meanings of the StructField, expecting the runtime representation of
anonymous fields instead of the exported reflect API representation.
It also did not document this fact, so that users had no way to know how
to create an anonymous field.

This CL changes StructOf to use the previously documented interpretation
of reflect.StructField instead of an undocumented one.

The implementation of StructOf also, in some cases, allowed creating
structs with unexported fields (if you knew how to ask) but set the
PkgPath incorrectly on those fields. Rather than try to fix that, this CL
changes StructOf to reject attempts to create unexported fields.
(I think that may be the right design choice, not just a temporary limitation.
In any event, it's not the topic for today's work.)

For #17766.
Fixes #18780.

Change-Id: I585a4e324dc5a90551f49d21ae04d2de9ea04b6c
Reviewed-on: https://go-review.googlesource.com/35731
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years ago[dev.typealias] cmd/doc: update for type alias
Russ Cox [Tue, 24 Jan 2017 19:53:31 +0000 (14:53 -0500)]
[dev.typealias] cmd/doc: update for type alias

For #18130.

Change-Id: I06b05a2b45a2aa6764053fc51e05883063572dad
Reviewed-on: https://go-review.googlesource.com/35670
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years ago[dev.typealias] cmd/compile: declare methods after resolving receiver type
Matthew Dempsky [Mon, 23 Jan 2017 22:24:24 +0000 (14:24 -0800)]
[dev.typealias] cmd/compile: declare methods after resolving receiver type

For #18130.
Fixes #18655.

Change-Id: I58e2f076b9d8273f128cc033bba9edcd06c81567
Reviewed-on: https://go-review.googlesource.com/35575
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years ago[dev.typealias] test: match gccgo error messages on alias2.go
Ian Lance Taylor [Tue, 24 Jan 2017 20:43:52 +0000 (12:43 -0800)]
[dev.typealias] test: match gccgo error messages on alias2.go

For #18130.

Change-Id: I9561ee2b8a9f7b11f0851f281a899f78b9e9703e
Reviewed-on: https://go-review.googlesource.com/35640
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years agodoc: update gccgo docs
Ian Lance Taylor [Tue, 24 Jan 2017 17:32:29 +0000 (09:32 -0800)]
doc: update gccgo docs

Update docs on correspondence between Go releases and GCC releases.

Update C type that corresponds to Go type `int`.

Drop out of date comments about Ubuntu and RTEMS.

Change-Id: Ic1b5ce9f242789af23ec3b7e7a64c9d257d6913e
Reviewed-on: https://go-review.googlesource.com/35631
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: clarify what to do with Go 1.4 when installing from source
Ian Lance Taylor [Tue, 24 Jan 2017 17:56:57 +0000 (09:56 -0800)]
doc: clarify what to do with Go 1.4 when installing from source

You have to actually run make.bash (or make.bat).

Update #18771.

Change-Id: Ie6672a4e4abde0150c1ae57cabb1222de2c78716
Reviewed-on: https://go-review.googlesource.com/35632
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agodoc: note that plugins are not fully baked
Brad Fitzpatrick [Mon, 23 Jan 2017 20:55:17 +0000 (20:55 +0000)]
doc: note that plugins are not fully baked

Change-Id: I6341b8cce0b4a9922928f73f8b459cbb9ec25e79
Reviewed-on: https://go-review.googlesource.com/35571
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
7 years agonet/http: don't send body on redirects for 301, 302, 303 when GetBody is set
Brad Fitzpatrick [Tue, 24 Jan 2017 17:52:54 +0000 (17:52 +0000)]
net/http: don't send body on redirects for 301, 302, 303 when GetBody is set

The presence of Request.GetBody being set on a request was causing all
redirected requests to have a body, even if the redirect status didn't
warrant one.

This bug came from 307/308 support (https://golang.org/cl/29852) which
removed the line that set req.Body to nil after POST/PUT redirects.

Change-Id: I2a4dd5320f810ae25cfd8ea8ca7c9700e5dbd369
Reviewed-on: https://go-review.googlesource.com/35633
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
7 years agonet/http: fix a nit
Mikio Hara [Tue, 24 Jan 2017 10:46:27 +0000 (19:46 +0900)]
net/http: fix a nit

Change-Id: I31fa5f906ad2e8dc475dbbeb91f568f91e16861b
Reviewed-on: https://go-review.googlesource.com/35514
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
7 years agocmd/link: mark DWARF function symbols as reachable
Ian Lance Taylor [Tue, 24 Jan 2017 01:30:41 +0000 (17:30 -0800)]
cmd/link: mark DWARF function symbols as reachable

Otherwise we don't emit any required ELF relocations when doing an
external link, because elfrelocsect skips unreachable symbols.

Fixes #18745.

Change-Id: Ia3583c41bb6c5ebb7579abd26ed8689370311cd6
Reviewed-on: https://go-review.googlesource.com/35590
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
7 years ago[dev.typealias] cmd/compile: change Func.Shortname to *Sym
Matthew Dempsky [Mon, 23 Jan 2017 21:40:25 +0000 (13:40 -0800)]
[dev.typealias] cmd/compile: change Func.Shortname to *Sym

A Func's Shortname is just an identifier. No need for an entire ONAME
Node.

Change-Id: Ie4d397e8d694c907fdf924ce57bd96bdb4aaabca
Reviewed-on: https://go-review.googlesource.com/35574
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
7 years agodoc: mention testing.MainStart signature change
Brad Fitzpatrick [Mon, 23 Jan 2017 22:26:27 +0000 (22:26 +0000)]
doc: mention testing.MainStart signature change

Fixes #18766

Change-Id: Ic0f72f3b7bbccd0546692993c4ed414f8c88c1c6
Reviewed-on: https://go-review.googlesource.com/35573
Reviewed-by: Russ Cox <rsc@golang.org>