]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
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>
8 years agospec: document that duplicate types are invalid in type switches
Robert Griesemer [Tue, 31 May 2016 20:32:34 +0000 (13:32 -0700)]
spec: document that duplicate types are invalid in type switches

Both compilers and also go/types don't permit duplicate types in
type switches; i.e., this spec change is documenting a status quo
that has existed for some time.

Furthermore, duplicate nils are not accepted by gccgo or go/types;
and more recently started causing a compiler error in gc. Permitting
them is inconsistent with the existing status quo.

Rather than making it an implementation restriction (as we have for
expression switches), this is a hard requirement since it was enforced
from the beginning (except for duplicate nils); it is also a well
specified requirement that does not pose a significant burden for
an implementation.

Fixes #15896.

Change-Id: If12db5bafa87598b323ea84418cb05421e657dd8
Reviewed-on: https://go-review.googlesource.com/23584
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoflag: recognize "0s" as the zero value for a flag.Duration
Ian Lance Taylor [Tue, 31 May 2016 18:23:50 +0000 (11:23 -0700)]
flag: recognize "0s" as the zero value for a flag.Duration

Implemented by using a reflect-based approach to recognize the zero
value of any non-interface type that implements flag.Value.  Interface
types will fall back to the old code.

Fixes #15904.

Change-Id: I594c3bfb30e9ab1aca3e008ef7f70be20aa41a0b
Reviewed-on: https://go-review.googlesource.com/23581
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
8 years agotest: add more switch error handling tests
Josh Bleecher Snyder [Tue, 31 May 2016 22:01:05 +0000 (15:01 -0700)]
test: add more switch error handling tests

Some of these errors are reported in the wrong places.
That’s issue #15911 and #15912.

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

8 years agocmd/go: combine gccgo's ld and ldShared methods
Michael Hudson-Doyle [Tue, 31 May 2016 08:48:42 +0000 (20:48 +1200)]
cmd/go: combine gccgo's ld and ldShared methods

This fixes handling of cgo flags and makes sure packages that are only
implicitly included in the shared library are passed to the link.

Fixes #15885

Change-Id: I1e8a72b5314261973ca903c78834700fb113dde9
Reviewed-on: https://go-review.googlesource.com/23537
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 agoruntime: fix restoring PC in ARM version of cgocallback_gofunc
Ian Lance Taylor [Tue, 31 May 2016 21:07:38 +0000 (14:07 -0700)]
runtime: fix restoring PC in ARM version of cgocallback_gofunc

Fixes #15856.

Change-Id: Ia8def161642087e4bd92a87298c77a0f9f83dc86
Reviewed-on: https://go-review.googlesource.com/23586
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: pass signal context to cgo traceback function
Ian Lance Taylor [Fri, 27 May 2016 17:05:52 +0000 (10:05 -0700)]
runtime: pass signal context to cgo traceback function

When doing a backtrace from a signal that occurs in C code compiled
without using -fasynchronous-unwind-tables, we have to rely on frame
pointers. In order to do that, the traceback function needs the signal
context to reliably pick up the frame pointer.

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

8 years agodoc/go1.7.html: make RFC an actual link
Joe Tsai [Tue, 31 May 2016 19:42:34 +0000 (12:42 -0700)]
doc/go1.7.html: make RFC an actual link

Change-Id: I5e8dad0c2534b5c3654cf0a0b51a38186d627a3c
Reviewed-on: https://go-review.googlesource.com/23582
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: update pprof binary header URL
Ian Lance Taylor [Fri, 27 May 2016 21:33:23 +0000 (14:33 -0700)]
runtime: update pprof binary header URL

The code has moved from code.google.com to github.com.

Change-Id: I0cc9eb69b3fedc9e916417bc7695759632f2391f
Reviewed-on: https://go-review.googlesource.com/23523
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/link: suppress PIE whenever externally linking with a sanitizer
Michael Hudson-Doyle [Tue, 31 May 2016 07:24:30 +0000 (19:24 +1200)]
cmd/link: suppress PIE whenever externally linking with a sanitizer

golang.org/issue/15443 complained that a race-enabled PIE binary crashed at
startup, but other ways of linking in tsan (or other sanitizers) such as

 #cgo CFLAGS: -fsanitize=thread
 #cgo LDFLAGS: -fsanitize=thread

have the same problem. Pass -no-pie to the host linker (if supported) if any
-fsanitizer=foo cgo LDFLAG is seen when linking.

Fixes #15887

Change-Id: Id799770f8d045f6f40fa8c463563937a5748d1a8
Reviewed-on: https://go-review.googlesource.com/23535
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, cmd/link: set LC_ALL=C when checking if host compiler supports -no-pie
Michael Hudson-Doyle [Tue, 31 May 2016 08:05:39 +0000 (20:05 +1200)]
cmd/go, cmd/link: set LC_ALL=C when checking if host compiler supports -no-pie

Fixes #15900

Change-Id: Ieada5f4e3b3b2ae358414e013f3090b4b820569b
Reviewed-on: https://go-review.googlesource.com/23536
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 agoruntime/cgo: add TSAN acquire/release calls
Ian Lance Taylor [Fri, 27 May 2016 00:47:03 +0000 (17:47 -0700)]
runtime/cgo: add TSAN acquire/release calls

Add TSAN acquire/release calls to runtime/cgo to match the ones
generated by cgo.  This avoids a false positive race around the malloc
memory used in runtime/cgo when other goroutines are simultaneously
calling malloc and free from cgo.

These new calls will only be used when building with CGO_CFLAGS and
CGO_LDFLAGS set to -fsanitize=thread, which becomes a requirement to
avoid all false positives when using TSAN.  These are needed not just
for runtime/cgo, but also for any runtime package that uses cgo (such as
net and os/user).

Add an unused attribute to the _cgo_tsan_acquire and _cgo_tsan_release
functions, in case there are no actual cgo function calls.

Add a test that checks that setting CGO_CFLAGS/CGO_LDFLAGS avoids a
false positive report when using os/user.

Change-Id: I0905c644ff7f003b6718aac782393fa219514c48
Reviewed-on: https://go-review.googlesource.com/23492
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agocmd/compile: disallow multiple nil cases in a type switch
Josh Bleecher Snyder [Mon, 30 May 2016 23:42:38 +0000 (16:42 -0700)]
cmd/compile: disallow multiple nil cases in a type switch

Fixes #15898.

Change-Id: I66e2ad21f283563c7142aa820f0354711d964768
Reviewed-on: https://go-review.googlesource.com/23573
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agocompress/flate: use seperate const block for exported constants
Joe Tsai [Sun, 29 May 2016 07:47:45 +0000 (00:47 -0700)]
compress/flate: use seperate const block for exported constants

As rendered on https://tip.golang.org/pkg/compress/flate/, there is an
extra new-line because of the unexported constants in the same block.

<<<
const (
    NoCompression      = 0
    BestSpeed          = 1
    BestCompression    = 9
    DefaultCompression = -1
    HuffmanOnly        = -2 // Disables match search and only does Huffman entropy reduction.

)
>>>

Instead, seperate the exported compression level constants into its own
const block. This is both more readable and also fixes the issue.

Change-Id: I60b7966c83fb53356c02e4640d05f55a3bee35b7
Reviewed-on: https://go-review.googlesource.com/23557
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/pprof, cmd/pprof: fix profiling for PIE
Ian Lance Taylor [Fri, 27 May 2016 23:03:44 +0000 (16:03 -0700)]
runtime/pprof, cmd/pprof: fix profiling for PIE

In order to support pprof for position independent executables, pprof
needs to adjust the PC addresses stored in the profile by the address at
which the program is loaded. The legacy profiling support which we use
already supports recording the GNU/Linux /proc/self/maps data
immediately after the CPU samples, so do that. Also change the pprof
symbolizer to use the information, if available, when looking up
addresses in the Go pcline data.

Fixes #15714.

Change-Id: I4bf679210ef7c51d85cf873c968ce82db8898e3e
Reviewed-on: https://go-review.googlesource.com/23525
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
8 years agocrypto/tls: reduce size of buffer in throughput benchmarks
Andrew Gerrand [Tue, 31 May 2016 03:21:35 +0000 (13:21 +1000)]
crypto/tls: reduce size of buffer in throughput benchmarks

The Windows builders run the throughput benchmarks really slowly with a
64kb buffer. Lowering it to 16kb brings the performance back into line
with the other builders.

This is a work-around to get the build green until we can figure out why
the Windows builders are slow with the larger buffer size.

Update #15899

Change-Id: I215ebf115e8295295c87f3b3e22a4ef1f9e77f81
Reviewed-on: https://go-review.googlesource.com/23574
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosyscall: plan9 - mark gbit16 as go:nosplit
Richard Miller [Sat, 28 May 2016 09:06:37 +0000 (10:06 +0100)]
syscall: plan9 - mark gbit16 as go:nosplit

This is a correction to CL 22610.  The gbit16 function is called in
StartProcess between fork and exec, and therefore must not split the
stack.  Normally it's inlined so this is not an issue, but on one
occasion I've observed it to be compiled without inlining, and the
result was a panic.  Mark it go:nosplit to be safe.

Change-Id: I0381754397b766431bf406d9767c73598d23b901
Reviewed-on: https://go-review.googlesource.com/23560
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agosync: document that RWMutex read locks may not be held recursively
Andrew Gerrand [Mon, 30 May 2016 05:17:14 +0000 (15:17 +1000)]
sync: document that RWMutex read locks may not be held recursively

Fixes #15418

Change-Id: Ibc51d602eb28819d0e44e5ca13a5c61573e4111c
Reviewed-on: https://go-review.googlesource.com/23570
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agopath/filepath: prevent infinite recursion on Windows on UNC input
Josh Bleecher Snyder [Mon, 30 May 2016 19:57:20 +0000 (12:57 -0700)]
path/filepath: prevent infinite recursion on Windows on UNC input

This is a minimal fix to prevent this and
other possible future infinite recursion.
We can put in a proper fix for UNC in Go 1.8.

Updates #15879

Change-Id: I3653cf5891bab8511adf66fa3c1a1d8912d1a293
Reviewed-on: https://go-review.googlesource.com/23572
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc: remove remnant mention of io.SizedReaderAt from Go 1.7 docs
Andrew Gerrand [Mon, 30 May 2016 05:17:14 +0000 (15:17 +1000)]
doc: remove remnant mention of io.SizedReaderAt from Go 1.7 docs

Updates #15810

Change-Id: I37f14a0ed1f5ac24ea2169a7e65c0469bfddd928
Reviewed-on: https://go-review.googlesource.com/23559
Reviewed-by: Michael McGreevy <mcgreevy@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agonet: don't call forceCloseSockets in non-TestMain functions
Mikio Hara [Fri, 27 May 2016 18:06:33 +0000 (03:06 +0900)]
net: don't call forceCloseSockets in non-TestMain functions

forceCloseSockets is just designed as a kingston valve for TestMain
function and is not suitable to keep track of inflight sockets.

Fixes #15525.

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

8 years agodoc: correct release notes for non-string map keys in encoding/json
Augusto Roman [Sat, 28 May 2016 23:59:28 +0000 (16:59 -0700)]
doc: correct release notes for non-string map keys in encoding/json

The original draft mentioned support for json.Marshaler, but that's
not the case.  JSON supports only string keys (not arbitrary JSON)
so only encoding.TextMarshaller is supported.

Change-Id: I7788fc23ac357da88e92aa0ca17b513260840cee
Reviewed-on: https://go-review.googlesource.com/23529
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/compile: shift tests, fix triple-shift rules
Keith Randall [Sun, 29 May 2016 04:15:24 +0000 (21:15 -0700)]
cmd/compile: shift tests, fix triple-shift rules

Add a bunch of tests for shifts.

Fix triple-shift rules to always take constant shifts as 64 bits.
(Earlier rules always promote shift amounts to 64 bits.)
Add overflow checks.

Increases generic rule coverage to 91%

Change-Id: I6b42d368d19d36ac482dbb8e0d4f67e30ad7145d
Reviewed-on: https://go-review.googlesource.com/23555
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agocmd/compile: add constant fold comparison tests
Keith Randall [Sun, 29 May 2016 04:59:17 +0000 (21:59 -0700)]
cmd/compile: add constant fold comparison tests

Increases generic.rules coverage from 91% to 95%.

Change-Id: I981eb94f3cd10d2f87c836576a43786787a25d83
Reviewed-on: https://go-review.googlesource.com/23556
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agoio: use SeekStart, SeekCurrent, and SeekEnd in io.Seeker documentation
Joe Tsai [Sat, 28 May 2016 09:14:25 +0000 (02:14 -0700)]
io: use SeekStart, SeekCurrent, and SeekEnd in io.Seeker documentation

The documentation previously used C style enumerations: 0, 1, 2.
While this is pretty much universally correct, it does not help a user
become aware of the existence of the SeekStart, SeekCurrent, and SeekEnd
constants. Thus, we should use them in the documentation to direct people's
attention to them.

Updates #6885

Change-Id: I44b5e78d41601c68a0a1c96428c853df53981d52
Reviewed-on: https://go-review.googlesource.com/23551
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agodoc/go1.7.html: update documentation regarding compress/flate
Joe Tsai [Sat, 28 May 2016 09:40:32 +0000 (02:40 -0700)]
doc/go1.7.html: update documentation regarding compress/flate

Document the following:
* That the algorithmic changes are still compliant with RFC 1951. I remember
people having questions regarding this issue, and it would be good to re-assure
them that it is still standards compliant.
* io.EOF can now be returned early (c27efce66bce7534dbb357ac1779bbc08395b267)
* Use the term "decompress" when referred to as an action. The term "uncompressed"
or "decompressed" are both valid as ways to represent the current state of the data.

Change-Id: Ie29ebce709357359e7c36d3e7f3d53b260eaadfa
Reviewed-on: https://go-review.googlesource.com/23552
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agonet/http/httputil: fix typos in deprecation comments
Emmanuel Odeke [Sat, 28 May 2016 08:33:23 +0000 (02:33 -0600)]
net/http/httputil: fix typos in deprecation comments

Fixes #15868

Change-Id: I4e4471e77091309c4ea1d546b2c4f20dfbb4314e
Reviewed-on: https://go-review.googlesource.com/23550
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agogo/types: better debugging output for init order computation
Robert Griesemer [Tue, 24 May 2016 00:43:09 +0000 (17:43 -0700)]
go/types: better debugging output for init order computation

Also: Added some test cases for issue #10709.
No impact when debugging output is disabled (default).

For #10709.

Change-Id: I0751befb222c86d46225377a674f6bad2990349e
Reviewed-on: https://go-review.googlesource.com/23442
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agostrings: fix and reenable amd64 Index for 17-31 byte strings
Ilya Tocar [Wed, 25 May 2016 13:33:19 +0000 (16:33 +0300)]
strings: fix and reenable amd64 Index for 17-31 byte strings

Fixes #15689

Change-Id: I56d0103738cc35cd5bc5e77a0e0341c0dd55530e
Reviewed-on: https://go-review.googlesource.com/23440
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
8 years agocmd/compile: SSA, don't let write barrier clobber return values
Keith Randall [Fri, 27 May 2016 21:07:37 +0000 (14:07 -0700)]
cmd/compile: SSA, don't let write barrier clobber return values

When we do *p = f(), we might need to copy the return value from
f to p with a write barrier.  The write barrier itself is a call,
so we need to copy the return value of f to a temporary location
before we call the write barrier function.  Otherwise, the call
itself (specifically, marshalling the args to typedmemmove) will
clobber the value we're trying to write.

Fixes #15854

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

8 years agodoc: mention frame pointers in Go 1.7 release notes
Russ Cox [Fri, 27 May 2016 20:30:03 +0000 (16:30 -0400)]
doc: mention frame pointers in Go 1.7 release notes

For #15840.

Change-Id: I2ecf5c7b00afc2034cf3d7a1fd78636a908beb67
Reviewed-on: https://go-review.googlesource.com/23517
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocrypto/tls: gofmt
Austin Clements [Fri, 27 May 2016 18:25:16 +0000 (14:25 -0400)]
crypto/tls: gofmt

Commit fa3543e introduced formatting errors.

Change-Id: I4b921f391a9b463cefca4318ad63b70ae6ce6865
Reviewed-on: https://go-review.googlesource.com/23514
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>

8 years agocmd/compile/internal/gc: gofmt
Austin Clements [Fri, 27 May 2016 18:24:26 +0000 (14:24 -0400)]
cmd/compile/internal/gc: gofmt

Commit 36a80c5 introduced formatting errors.

Change-Id: I6d5b231200cd7abcd5b94c1a3f4e99f10ee11c4f
Reviewed-on: https://go-review.googlesource.com/23513
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>

8 years agocrypto/tls: fix race in Benchmark{Throughput,Latency}
Mikio Hara [Fri, 27 May 2016 18:20:11 +0000 (03:20 +0900)]
crypto/tls: fix race in Benchmark{Throughput,Latency}

Fixes #15864.

Change-Id: Ic12aa3654bf0b7e4a26df20ea92d07d7efe7339c
Reviewed-on: https://go-review.googlesource.com/23504
Reviewed-by: David Chase <drchase@google.com>
8 years agonet/http/httptrace: fix nit in test
Mikio Hara [Fri, 27 May 2016 08:35:45 +0000 (17:35 +0900)]
net/http/httptrace: fix nit in test

Change-Id: I6dc3666398b4cd7a7195bb9c0e321fa8b733fa15
Reviewed-on: https://go-review.googlesource.com/23502
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: skip TestGdbBacktrace on netbsd
Mikio Hara [Fri, 27 May 2016 08:34:22 +0000 (17:34 +0900)]
runtime: skip TestGdbBacktrace on netbsd

Also adds missing copyright notice.

Updates #15603.

Change-Id: Icf4bb45ba5edec891491fe5f0039a8a25125d168
Reviewed-on: https://go-review.googlesource.com/23501
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: always call stackfree on the system stack
Austin Clements [Fri, 27 May 2016 16:21:14 +0000 (12:21 -0400)]
runtime: always call stackfree on the system stack

Currently when the garbage collector frees stacks of dead goroutines
in markrootFreeGStacks, it calls stackfree on a regular user stack.
This is a problem, since stackfree manipulates the stack cache in the
per-P mcache, so if it grows the stack or gets preempted in the middle
of manipulating the stack cache (which are both possible since it's on
a user stack), it can easily corrupt the stack cache.

Fix this by calling markrootFreeGStacks on the system stack, so that
all calls to stackfree happen on the system stack. To prevent this bug
in the future, mark stack functions that manipulate the mcache as
go:systemstack.

Fixes #15853.

Change-Id: Ic0d1c181efb342f134285a152560c3a074f14a3d
Reviewed-on: https://go-review.googlesource.com/23511
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: record Python stack on TestGdbPython failure
Austin Clements [Thu, 26 May 2016 15:05:01 +0000 (11:05 -0400)]
runtime: record Python stack on TestGdbPython failure

For #15599.

Change-Id: Icc2e58a3f314b7a098d78fe164ba36f5b2897de6
Reviewed-on: https://go-review.googlesource.com/23481
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocrypto/tls: adjust dynamic record sizes to grow arithmetically
Russ Cox [Fri, 27 May 2016 13:50:06 +0000 (09:50 -0400)]
crypto/tls: adjust dynamic record sizes to grow arithmetically

The current code, introduced after Go 1.6 to improve latency on
low-bandwidth connections, sends 1 kB packets until 1 MB has been sent,
and then sends 16 kB packets (the maximum record size).

Unfortunately this decreases throughput for 1-16 MB responses by 20% or so.

Following discussion on #15713, change cutoff to 128 kB sent
and also grow the size allowed for successive packets:
1 kB, 2 kB, 3 kB, ..., 15 kB, 16 kB.
This fixes the throughput problems: the overhead is now closer to 2%.

I hope this still helps with latency but I don't have a great way to test it.
At the least, it's not worse than Go 1.6.

Comparing MaxPacket vs DynamicPacket benchmarks:

name              maxpkt time/op  dyn. time/op delta
Throughput/1MB-8    5.07ms ± 7%   5.21ms ± 7%  +2.73%  (p=0.023 n=16+16)
Throughput/2MB-8   15.7ms ±201%    8.4ms ± 5%    ~     (p=0.604 n=20+16)
Throughput/4MB-8    14.3ms ± 1%   14.5ms ± 1%  +1.53%  (p=0.000 n=16+16)
Throughput/8MB-8    26.6ms ± 1%   26.8ms ± 1%  +0.47%  (p=0.003 n=19+18)
Throughput/16MB-8   51.0ms ± 1%   51.3ms ± 1%  +0.47%  (p=0.000 n=20+20)
Throughput/32MB-8    100ms ± 1%    100ms ± 1%  +0.24%  (p=0.033 n=20+20)
Throughput/64MB-8    197ms ± 0%    198ms ± 0%  +0.56%   (p=0.000 n=18+7)

The small MB runs are bimodal in both cases, probably GC pauses.
But there's clearly no general slowdown anymore.

Fixes #15713.

Change-Id: I5fc44680ba71812d24baac142bceee0e23f2e382
Reviewed-on: https://go-review.googlesource.com/23487
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agodoc/go1.7.html: fix broken sentence
Russ Cox [Fri, 27 May 2016 16:15:04 +0000 (12:15 -0400)]
doc/go1.7.html: fix broken sentence

Change-Id: Ia540c890767dcb001d3b3b55d98d9517b13b21da
Reviewed-on: https://go-review.googlesource.com/23510
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agonet/http: change Transport.Dialer to Transport.DialContext
Russ Cox [Fri, 27 May 2016 15:05:14 +0000 (11:05 -0400)]
net/http: change Transport.Dialer to Transport.DialContext

New in Go 1.7 so still possible to change.
This allows implementations not tied to *net.Dialer.

Fixes #15748.

Change-Id: I5fabbf13c7f1951c06587a4ccd120def488267ce
Reviewed-on: https://go-review.googlesource.com/23489
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: clean up, document Node closure fields
Russ Cox [Fri, 27 May 2016 04:56:19 +0000 (00:56 -0400)]
cmd/compile: clean up, document Node closure fields

Requested during CL 23431.

Change-Id: I513ae42166b3a9fcfe51231ff55c163ab672e7d2
Reviewed-on: https://go-review.googlesource.com/23485
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/compile: delete Func.Outer
Russ Cox [Fri, 27 May 2016 03:43:19 +0000 (23:43 -0400)]
cmd/compile: delete Func.Outer

This was just storage for a linked list.

Change-Id: I850e8db1e1f5e72410f5c904be9409179b56a94a
Reviewed-on: https://go-review.googlesource.com/23484
Reviewed-by: David Chase <drchase@google.com>
8 years agodoc/go1.7.html: incorporate Rob's comments from CL 23379
Russ Cox [Fri, 27 May 2016 14:58:00 +0000 (10:58 -0400)]
doc/go1.7.html: incorporate Rob's comments from CL 23379

For #15810.

Change-Id: Ib529808f664392feb9b36770f3d3d875fcb54528
Reviewed-on: https://go-review.googlesource.com/23488
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agodoc/go1.7: document signal name printing during panics
Emmanuel Odeke [Fri, 27 May 2016 08:31:59 +0000 (02:31 -0600)]
doc/go1.7: document signal name printing during panics

Document new behavior about signal name printing
in panics as per CL golang.org/cl/22753.

For #15810

Change-Id: I9c677d5dd779b41e82afa25e3c797d8e739600d3
Reviewed-on: https://go-review.googlesource.com/23493
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: additional paranoia and checking in plive.go
Russ Cox [Wed, 25 May 2016 14:01:58 +0000 (10:01 -0400)]
cmd/compile: additional paranoia and checking in plive.go

The main check here is that liveness now crashes if it finds an instruction
using a variable that should be tracked but is not.

Comments and adjustments in nodarg to explain what's going on and
to remove the "-1" argument added a few months ago, plus a sketch
of a future simplification.

The need for n.Orig in the earlier CL seems to have been an intermediate
problem rather than fundamental: the new explanations in nodarg make
clear that nodarg is not causing the problem I thought, and in fact now
using n instead of n.Orig works fine in plive.go.

Change-Id: I3f5cf9f6e4438a6d27abac7d490e7521545cd552
Reviewed-on: https://go-review.googlesource.com/23450
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
8 years agocmd/go: fixup for parsing SCP-like addresses
Dmitri Shuralyov [Thu, 26 May 2016 06:22:11 +0000 (23:22 -0700)]
cmd/go: fixup for parsing SCP-like addresses

This is a fixup change for commit 5cd294480364eb166751838a3df8f58649c214e1
that added parsing of SCP-like addresses. To get the expected output
from (*url.URL).String(), Path needs to be set, not RawPath.

Add a test for this, since it has already regressed multiple times.

Updates #11457.

Change-Id: I806f5abbd3cf65e5bdcef01aab872caa8a5b8891
Reviewed-on: https://go-review.googlesource.com/23447
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/compile: eliminate PPARAMREF
Russ Cox [Wed, 25 May 2016 14:29:50 +0000 (10:29 -0400)]
cmd/compile: eliminate PPARAMREF

As in the elimination of PHEAP|PPARAM in CL 23393,
this is something the front end can trivially take care of
and then not bother the back ends with.
It also eliminates some suspect (and only lightly exercised)
code paths in the back ends.

I don't have a smoking gun for this one but it seems
more clearly correct.

Change-Id: I3b3f5e669b3b81d091ff1e2fb13226a6f14c69d5
Reviewed-on: https://go-review.googlesource.com/23431
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>

8 years agocmd/compile: fix liveness computation for heap-escaped parameters
Russ Cox [Wed, 25 May 2016 05:33:24 +0000 (01:33 -0400)]
cmd/compile: fix liveness computation for heap-escaped parameters

The liveness computation of parameters generally was never
correct, but forcing all parameters to be live throughout the
function covered up that problem. The new SSA back end is
too clever: even though it currently keeps the parameter values live
throughout the function, it may find optimizations that mean
the current values are not written back to the original parameter
stack slots immediately or ever (for example if a parameter is set
to nil, SSA constant propagation may replace all later uses of the
parameter with a constant nil, eliminating the need to write the nil
value back to the stack slot), so the liveness code must now
track the actual operations on the stack slots, exposing these
problems.

One small problem in the handling of arguments is that nodarg
can return ONAME PPARAM nodes with adjusted offsets, so that
there are actually multiple *Node pointers for the same parameter
in the instruction stream. This might be possible to correct, but
not in this CL. For now, we fix this by using n.Orig instead of n
when considering PPARAM and PPARAMOUT nodes.

The major problem in the handling of arguments is general
confusion in the liveness code about the meaning of PPARAM|PHEAP
and PPARAMOUT|PHEAP nodes, especially as contrasted with PAUTO|PHEAP.
The difference between these two is that when a local variable "moves"
to the heap, it's really just allocated there to start with; in contrast,
when an argument moves to the heap, the actual data has to be copied
there from the stack at the beginning of the function, and when a
result "moves" to the heap the value in the heap has to be copied
back to the stack when the function returns
This general confusion is also present in the SSA back end.

The PHEAP bit worked decently when I first introduced it 7 years ago (!)
in 391425ae. The back end did nothing sophisticated, and in particular
there was no analysis at all: no escape analysis, no liveness analysis,
and certainly no SSA back end. But the complications caused in the
various downstream consumers suggest that this should be a detail
kept mainly in the front end.

This CL therefore eliminates both the PHEAP bit and even the idea of
"heap variables" from the back ends.

First, it replaces the PPARAM|PHEAP, PPARAMOUT|PHEAP, and PAUTO|PHEAP
variable classes with the single PAUTOHEAP, a pseudo-class indicating
a variable maintained on the heap and available by indirecting a
local variable kept on the stack (a plain PAUTO).

Second, walkexpr replaces all references to PAUTOHEAP variables
with indirections of the corresponding PAUTO variable.
The back ends and the liveness code now just see plain indirected
variables. This may actually produce better code, but the real goal
here is to eliminate these little-used and somewhat suspect code
paths in the back end analyses.

The OPARAM node type goes away too.

A followup CL will do the same to PPARAMREF. I'm not sure that
the back ends (SSA in particular) are handling those right either,
and with the framework established in this CL that change is trivial
and the result clearly more correct.

Fixes #15747.

Change-Id: I2770b1ce3cbc93981bfc7166be66a9da12013d74
Reviewed-on: https://go-review.googlesource.com/23393
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agopath/filepath: fix globbing of c:\*dir\... pattern
Alex Brainman [Thu, 19 May 2016 05:58:40 +0000 (15:58 +1000)]
path/filepath: fix globbing of c:\*dir\... pattern

The problem was introduced by the recent filepath.Join change.

Fixes #14949

Change-Id: I7ee52f210e12bbb1369e308e584ddb2c7766e095
Reviewed-on: https://go-review.googlesource.com/23240
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/cgo: remove -O options when generating compiler errors
Ian Lance Taylor [Thu, 19 May 2016 01:42:25 +0000 (18:42 -0700)]
cmd/cgo: remove -O options when generating compiler errors

The cgo tool generates compiler errors to find out what kind of name it
is using.  Turning on optimization can confuse that process by producing
new unexpected messages.

Fixes #14669.

Change-Id: Idc8e35fd259711ecc9638566b691c11d17140325
Reviewed-on: https://go-review.googlesource.com/23231
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: testing harness for checking generated assembly
Keith Randall [Tue, 24 May 2016 21:09:02 +0000 (14:09 -0700)]
cmd/compile: testing harness for checking generated assembly

Add a test which compiles a function and checks the
generated assembly to make sure certain patterns are present.
This test allows us to do white box tests of the compiler
to make sure optimizations don't regress.

Added a few simple tests for now.  More to come.

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

8 years agoencoding/json: improve Decode example
Quentin Smith [Thu, 26 May 2016 21:53:21 +0000 (17:53 -0400)]
encoding/json: improve Decode example

Decoding a JSON message does not touch unspecified or null fields;
always use a new underlying struct to prevent old field values from
sticking around.

Fixes: #14640
Change-Id: Ica78c208ce104e2cdee1d4e92bf58596ea5587c8
Reviewed-on: https://go-review.googlesource.com/23483
Reviewed-by: Andrew Gerrand <adg@golang.org>
8 years agocmd/compile: add tests for logical simplification rewrite rules
Keith Randall [Thu, 26 May 2016 21:31:35 +0000 (14:31 -0700)]
cmd/compile: add tests for logical simplification rewrite rules

Increases coverage of generic.rules from 72% to 84%.

Change-Id: I1b139aeeb6410d025d49cbe4e4601f6f935ce1e5
Reviewed-on: https://go-review.googlesource.com/23490
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agocmd/compile: log rules to a file for rule coverage tool
Keith Randall [Tue, 24 May 2016 22:43:25 +0000 (15:43 -0700)]
cmd/compile: log rules to a file for rule coverage tool

When rules are generated with -log, log rule application to a file.

The file is opened in append mode so multiple calls to the compiler
union their logs.

Change-Id: Ib35c7c85bf58e5909ea9231043f8cbaa6bf278b7
Reviewed-on: https://go-review.googlesource.com/23406
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
8 years agocmd/compile: improve domorder documentation
Josh Bleecher Snyder [Thu, 26 May 2016 19:16:53 +0000 (12:16 -0700)]
cmd/compile: improve domorder documentation

domorder has some non-obvious useful properties
that we’re relying on in cse.
Document them and provide an argument that they hold.
While we’re here, do some minor renaming.

The argument is a re-working of a private email
exchange with Todd Neal and David Chase.

Change-Id: Ie154e0521bde642f5f11e67fc542c5eb938258be
Reviewed-on: https://go-review.googlesource.com/23449
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 years agomath/big: using Run for some more benchmarks
Marcel van Lohuizen [Thu, 26 May 2016 09:29:53 +0000 (11:29 +0200)]
math/big: using Run for some more benchmarks

Change-Id: I3ede8098f405de5d88e51c8370d3b68446d40744
Reviewed-on: https://go-review.googlesource.com/23428
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/dist: drop ppc64le from testcshared
Russ Cox [Thu, 26 May 2016 19:02:55 +0000 (15:02 -0400)]
cmd/dist: drop ppc64le from testcshared

I'm glad my CL fixed the library use case inside Google.
It fixes neither of the two tests here.

Change-Id: Ica91722dced8955a0a8ba3aad3d288816b46564e
Reviewed-on: https://go-review.googlesource.com/23482
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agobuild: enable framepointer mode by default
Russ Cox [Wed, 25 May 2016 18:37:43 +0000 (14:37 -0400)]
build: enable framepointer mode by default

This has a minor performance cost, but far less than is being gained by SSA.
As an experiment, enable it during the Go 1.7 beta.
Having frame pointers on by default makes Linux's perf, Intel VTune,
and other profilers much more useful, because it lets them gather a
stack trace efficiently on profiling events.
(It doesn't help us that much, since when we walk the stack we usually
need to look up PC-specific information as well.)

Fixes #15840.

Change-Id: I4efd38412a0de4a9c87b1b6e5d11c301e63f1a2a
Reviewed-on: https://go-review.googlesource.com/23451
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agomath/big: simplify benchmarking code some more
Robert Griesemer [Thu, 26 May 2016 00:29:56 +0000 (17:29 -0700)]
math/big: simplify benchmarking code some more

Follow-up cleanup to https://golang.org/cl/23424/ .

Change-Id: Ifb05c1ff5327df6bc5f4cbc554e18363293f7960
Reviewed-on: https://go-review.googlesource.com/23446
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
8 years agoruntime: tell race detector about reflectOffs.lock
David Crawshaw [Wed, 25 May 2016 17:19:11 +0000 (13:19 -0400)]
runtime: tell race detector about reflectOffs.lock

Fixes #15832

Change-Id: I6f3f45e3c21edd0e093ecb1d8a067907863478f5
Reviewed-on: https://go-review.googlesource.com/23441
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
8 years agocmd/dist: drop testcarchive on ppc64le
Russ Cox [Thu, 26 May 2016 13:59:29 +0000 (09:59 -0400)]
cmd/dist: drop testcarchive on ppc64le

It is timing out on the dashboard.
(We enabled it as an experiment to see if it was still broken. Looks that way.)

Change-Id: I425b7e54a2ab95b623ab7a15554b4173078f75e2
Reviewed-on: https://go-review.googlesource.com/23480
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agoruntime: unwind BP in jmpdefer to match SP unwind
Austin Clements [Thu, 26 May 2016 00:56:56 +0000 (20:56 -0400)]
runtime: unwind BP in jmpdefer to match SP unwind

The irregular calling convention for defers currently incorrectly
manages the BP if frame pointers are enabled. Specifically, jmpdefer
manipulates the SP as if its own caller, deferreturn, had returned.
However, it does not manipulate the BP to match. As a result, when a
BP-based traceback happens during a deferred function call, it unwinds
to the function that performed the defer and then thinks that function
called itself in an infinite regress.

Fix this by making jmpdefer manipulate the BP as if deferreturn had
actually returned.

Fixes #12968.

Updates #15840.

Change-Id: Ic9cc7c863baeaf977883ed0c25a7e80e592cf066
Reviewed-on: https://go-review.googlesource.com/23457
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocmd/link/internal/ld: fix DWARF offsets with GOEXPERIMENT=framepointer
Austin Clements [Thu, 26 May 2016 02:59:19 +0000 (22:59 -0400)]
cmd/link/internal/ld: fix DWARF offsets with GOEXPERIMENT=framepointer

The offsets computed by the DWARF expressions for local variables
currently don't account for the extra stack slot used by the frame
pointer when GOEXPERIMENT=framepointer is enabled.

Fix this by adding the extra stack slot to the offset.

This fixes TestGdbPython with GOEXPERIMENT=framepointer.

Updates #15840.

Change-Id: I1b2ebb2750cd22266f4a89ec8d9e8bfa05fabd19
Reviewed-on: https://go-review.googlesource.com/23458
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agoruntime: make framepointer mode safe for Windows
Russ Cox [Thu, 26 May 2016 00:01:25 +0000 (20:01 -0400)]
runtime: make framepointer mode safe for Windows

A few other architectures have already defined a NOFRAME flag.
Use it to disable frame pointer code on a few very low-level functions
that must behave like Windows code.

Makes the failing os/signal test pass on a Windows gomote.

Change-Id: I982365f2c59a0aa302b4428c970846c61027cf3e
Reviewed-on: https://go-review.googlesource.com/23456
Reviewed-by: Austin Clements <austin@google.com>
8 years agocrypto/sha1: fix AVX2 variant on AMD64
Ilya Tocar [Tue, 17 May 2016 17:55:55 +0000 (20:55 +0300)]
crypto/sha1: fix AVX2 variant on AMD64

AVX2 variant reads next blocks while calculating current block.
Avoid reading past the end of data, by switching back to original,
for last blocks.

Fixes #15617.

Change-Id: I04fa2d83f1b47995117c77b4a3d403a7dff594d4
Reviewed-on: https://go-review.googlesource.com/23138
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: add library startup support for ppc64le
Russ Cox [Wed, 25 May 2016 18:54:21 +0000 (14:54 -0400)]
runtime: add library startup support for ppc64le

I have been running this patch inside Google against Go 1.6 for the last month.

The new tests will probably break the builders but let's see
exactly how they break.

Change-Id: Ia65cf7d3faecffeeb4b06e9b80875c0e57d86d9e
Reviewed-on: https://go-review.googlesource.com/23452
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agocmd/compile: correctly import labels, gotos, and fallthroughs
Robert Griesemer [Wed, 25 May 2016 23:38:02 +0000 (16:38 -0700)]
cmd/compile: correctly import labels, gotos, and fallthroughs

The importer had several bugs with respect to labels and gotos:
- it didn't create a new ONAME node for label names (label dcl,
  goto, continue, and break)
- it overwrote the symbol for gotos with the dclstack
- it didn't set the dclstack for labels

In the process changed export format slightly to always assume
a label name for labels and gotos, and never assume a label for
fallthroughs.

For fallthroughs and switch cases, now also set Xoffset like in
the parser. (Not setting it, i.e., using 0 was ok since this is
only used for verifying correct use of fallthroughs, which was
checked already. But it's an extra level of verification of the
import.)

Fixes #15838.

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

8 years agonet/http: add missing HTTP status codes
Seth Vargo [Thu, 12 May 2016 20:26:27 +0000 (16:26 -0400)]
net/http: add missing HTTP status codes

This commit adds missing status codes:

* 102 - Processing
* 207 - Multi-Status
* 208 - Already Reported
* 226 - IM Used
* 308 - Permanent Redirect
* 422 - Unprocessable Entity
* 423 - Locked
* 424 - Failed Dependency
* 426 - Upgrade Required
* 506 - Variant Also Negotiates
* 507 - Insufficient Storage
* 508 - Loop Detected
* 510 - Not Extended
* 511 - Network Authentication Required

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

8 years agocmd/cgo, runtime, runtime/cgo: TSAN support for malloc
Ian Lance Taylor [Thu, 19 May 2016 23:27:23 +0000 (16:27 -0700)]
cmd/cgo, runtime, runtime/cgo: TSAN support for malloc

Acquire and release the TSAN synchronization point when calling malloc,
just as we do when calling any other C function. If we don't do this,
TSAN will report false positive errors about races calling malloc and
free.

We used to have a special code path for malloc and free, going through
the runtime functions cmalloc and cfree. The special code path for cfree
was no longer used even before this CL. This CL stops using the special
code path for malloc, because there is no place along that path where we
could conditionally insert the TSAN synchronization. This CL removes
the support for the special code path for both functions.

Instead, cgo now automatically generates the malloc function as though
it were referenced as C.malloc.  We need to automatically generate it
even if C.malloc is not called, even if malloc and size_t are not
declared, to support cgo-provided functions like C.CString.

Change-Id: I829854ec0787a80f33fa0a8a0dc2ee1d617830e2
Reviewed-on: https://go-review.googlesource.com/23260
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: align C library startup calls on amd64
Russ Cox [Wed, 25 May 2016 21:24:11 +0000 (17:24 -0400)]
runtime: align C library startup calls on amd64

This makes GOEXPERIMENT=framepointer, GOOS=darwin, and buildmode=carchive coexist.

Change-Id: I9f6fb2f0f06f27df683e5b51f2fa55cd21872453
Reviewed-on: https://go-review.googlesource.com/23454
Reviewed-by: Austin Clements <austin@google.com>
8 years agoruntime: pass gcWork to scanstack
Austin Clements [Tue, 24 May 2016 02:14:53 +0000 (22:14 -0400)]
runtime: pass gcWork to scanstack

Currently scanstack obtains its own gcWork from the P for the duration
of the stack scan and then, if called during mark termination,
disposes the gcWork.

However, this means that the number of workbufs allocated will be at
least the number of stacks scanned during mark termination, which may
be very high (especially during a STW GC). This happens because, in
steady state, each scanstack will obtain a fresh workbuf (either from
the empty list or by allocating it), fill it with the scan results,
and then dispose it to the full list. Nothing is consuming from the
full list during this (and hence nothing is recycling them to the
empty list), so the length of the full list by the time mark
termination starts draining it is at least the number of stacks
scanned.

Fix this by pushing the gcWork acquisition up the stack to either the
gcDrain that calls markroot that calls scanstack (which batches across
many stack scans and is the path taken during STW GC) or to newstack
(which is still a single scanstack call, but this is roughly bounded
by the number of Ps).

This fix reduces the workbuf allocation for the test program from
issue #15319 from 213 MB (roughly 2KB * 1e5 goroutines) to 10 MB.

Fixes #15319.

Note that there's potentially a similar issue in write barriers during
mark 2. Fixing that will be more difficult since there's no broader
non-preemptible context, but it should also be less of a problem since
the full list is being drained during mark 2.

Some overall improvements in the go1 benchmarks, plus the usual noise.
No significant change in the garbage benchmark (time/op or GC memory).

name                      old time/op    new time/op    delta
BinaryTree17-12              2.54s ± 1%     2.51s ± 1%  -1.09%  (p=0.000 n=20+19)
Fannkuch11-12                2.12s ± 0%     2.17s ± 0%  +2.18%  (p=0.000 n=19+18)
FmtFprintfEmpty-12          45.1ns ± 1%    45.2ns ± 0%    ~     (p=0.078 n=19+18)
FmtFprintfString-12          127ns ± 0%     128ns ± 0%  +1.08%  (p=0.000 n=19+16)
FmtFprintfInt-12             125ns ± 0%     122ns ± 1%  -2.71%  (p=0.000 n=14+18)
FmtFprintfIntInt-12          196ns ± 0%     190ns ± 1%  -2.91%  (p=0.000 n=12+20)
FmtFprintfPrefixedInt-12     196ns ± 0%     194ns ± 1%  -0.94%  (p=0.000 n=13+18)
FmtFprintfFloat-12           253ns ± 1%     251ns ± 1%  -0.86%  (p=0.000 n=19+20)
FmtManyArgs-12               807ns ± 1%     784ns ± 1%  -2.85%  (p=0.000 n=20+20)
GobDecode-12                7.13ms ± 1%    7.12ms ± 1%    ~     (p=0.351 n=19+20)
GobEncode-12                5.89ms ± 0%    5.95ms ± 0%  +0.94%  (p=0.000 n=19+19)
Gzip-12                      219ms ± 1%     221ms ± 1%  +1.35%  (p=0.000 n=18+20)
Gunzip-12                   37.5ms ± 1%    37.4ms ± 0%    ~     (p=0.057 n=20+19)
HTTPClientServer-12         81.4µs ± 4%    81.9µs ± 3%    ~     (p=0.118 n=17+18)
JSONEncode-12               15.7ms ± 1%    15.8ms ± 1%  +0.73%  (p=0.000 n=17+18)
JSONDecode-12               57.9ms ± 1%    57.2ms ± 1%  -1.34%  (p=0.000 n=19+19)
Mandelbrot200-12            4.12ms ± 1%    4.10ms ± 0%  -0.33%  (p=0.000 n=19+17)
GoParse-12                  3.22ms ± 2%    3.25ms ± 1%  +0.72%  (p=0.000 n=18+20)
RegexpMatchEasy0_32-12      70.6ns ± 1%    71.1ns ± 2%  +0.63%  (p=0.005 n=19+20)
RegexpMatchEasy0_1K-12       240ns ± 0%     239ns ± 1%  -0.59%  (p=0.000 n=19+20)
RegexpMatchEasy1_32-12      71.3ns ± 1%    71.3ns ± 1%    ~     (p=0.844 n=17+17)
RegexpMatchEasy1_1K-12       384ns ± 2%     371ns ± 1%  -3.45%  (p=0.000 n=19+20)
RegexpMatchMedium_32-12      109ns ± 1%     108ns ± 2%  -0.48%  (p=0.029 n=19+19)
RegexpMatchMedium_1K-12     34.3µs ± 1%    34.5µs ± 2%    ~     (p=0.160 n=18+20)
RegexpMatchHard_32-12       1.79µs ± 9%    1.72µs ± 2%  -3.83%  (p=0.000 n=19+19)
RegexpMatchHard_1K-12       53.3µs ± 4%    51.8µs ± 1%  -2.82%  (p=0.000 n=19+20)
Revcomp-12                   386ms ± 0%     388ms ± 0%  +0.72%  (p=0.000 n=17+20)
Template-12                 62.9ms ± 1%    62.5ms ± 1%  -0.57%  (p=0.010 n=18+19)
TimeParse-12                 325ns ± 0%     331ns ± 0%  +1.84%  (p=0.000 n=18+19)
TimeFormat-12                338ns ± 0%     343ns ± 0%  +1.34%  (p=0.000 n=18+20)
[Geo mean]                  52.7µs         52.5µs       -0.42%

Change-Id: Ib2d34736c4ae2ec329605b0fbc44636038d8d018
Reviewed-on: https://go-review.googlesource.com/23391
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
8 years agoruntime: document scanstack
Austin Clements [Tue, 24 May 2016 02:05:51 +0000 (22:05 -0400)]
runtime: document scanstack

Also mark it go:systemstack and explain why.

Change-Id: I88baf22741c04012ba2588d8e03dd3801d19b5c0
Reviewed-on: https://go-review.googlesource.com/23390
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
8 years agocmd/compile: document how to update builtin.go
Robert Griesemer [Wed, 25 May 2016 18:23:56 +0000 (11:23 -0700)]
cmd/compile: document how to update builtin.go

No code changes.

Fixes #15835.

Change-Id: Ibae3f20882f976babc4093df5e9fea0b2cf0e9d9
Reviewed-on: https://go-review.googlesource.com/23443
Reviewed-by: Alan Donovan <adonovan@google.com>
8 years agodoc: reflect {Num,}Method skips unexported methods
David Crawshaw [Wed, 25 May 2016 12:03:46 +0000 (08:03 -0400)]
doc: reflect {Num,}Method skips unexported methods

For #15673

Change-Id: I3ce8d4016854d41860c5a9f05a54cda3de49f337
Reviewed-on: https://go-review.googlesource.com/23430
Reviewed-by: Ian Lance Taylor <iant@golang.org>
8 years agomath/big: use run for benchmarks
Marcel van Lohuizen [Wed, 25 May 2016 12:57:49 +0000 (14:57 +0200)]
math/big: use run for benchmarks

shortens code and gives an example of the use of Run.

Change-Id: I75ffaf762218a589274b4b62e19022e31e805d1b
Reviewed-on: https://go-review.googlesource.com/23424
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: use Run for more benchmarks
Marcel van Lohuizen [Wed, 25 May 2016 17:34:01 +0000 (19:34 +0200)]
runtime: use Run for more benchmarks

Names for Append?Bytes are slightly changed in addition to adding a slash.

Change-Id: I0291aa29c693f9040fd01368eaad9766259677df
Reviewed-on: https://go-review.googlesource.com/23426
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocompress/flate: simplify using subtests and sub-benchmarks
Marcel van Lohuizen [Wed, 25 May 2016 09:19:17 +0000 (11:19 +0200)]
compress/flate: simplify using subtests and sub-benchmarks

This causes the large files to be loaded only once per benchmark.

This CL also serves as an example use case of sub(tests|-benchmarks).

This CL ensures that names are identical to the original
except for an added slashes. Things could be
simplified further if this restriction were dropped.

Change-Id: I45e303e158e3152e33d0d751adfef784713bf997
Reviewed-on: https://go-review.googlesource.com/23420
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agotesting: added package doc for sub(tests/benchmarks)
Marcel van Lohuizen [Tue, 24 May 2016 18:03:31 +0000 (20:03 +0200)]
testing: added package doc for sub(tests/benchmarks)

Change-Id: I6991cd7a41140da784a1ff8d69c5ea2032d05850
Reviewed-on: https://go-review.googlesource.com/23354
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agocompress/lzw: use Run for benchmarks
Marcel van Lohuizen [Wed, 25 May 2016 12:54:41 +0000 (14:54 +0200)]
compress/lzw: use Run for benchmarks

load file only once per group.

Change-Id: I965661507055e6e100506bf14d37133ecdd2cc5e
Reviewed-on: https://go-review.googlesource.com/23423
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agoruntime: use of Run for some benchmarks
Marcel van Lohuizen [Wed, 25 May 2016 13:44:39 +0000 (15:44 +0200)]
runtime: use of Run for some benchmarks

Names of sub-benchmarks are preserved, short of the additional slash.

Change-Id: I9b3f82964f9a44b0d28724413320afd091ed3106
Reviewed-on: https://go-review.googlesource.com/23425
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

8 years agotext/scanner: better error message if no error handler is installed
Robert Griesemer [Tue, 24 May 2016 19:54:14 +0000 (12:54 -0700)]
text/scanner: better error message if no error handler is installed

This is reverting golang.org/cl/19622 and introducing "<input>"
as filename if no filename is specified.

Fixes #15813.

Change-Id: Iafc74b789fa33f48ee639c42d4aebc6f06435f95
Reviewed-on: https://go-review.googlesource.com/23402
Reviewed-by: Russ Cox <rsc@golang.org>
8 years agocmd/compile: add generated tests for constant folding
Keith Randall [Tue, 24 May 2016 23:53:48 +0000 (16:53 -0700)]
cmd/compile: add generated tests for constant folding

Covers a bunch of constant-folding rules in generic.rules that aren't
being covered currently.

Increases coverage in generic.rules from 65% to 72%.

Change-Id: I7bf58809faf22e97070183b42e6dd7d3f35bf5f9
Reviewed-on: https://go-review.googlesource.com/23407
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
8 years agoreflect: remove type info for unexported methods
David Crawshaw [Tue, 24 May 2016 23:04:51 +0000 (19:04 -0400)]
reflect: remove type info for unexported methods

Also remove some of the now unnecessary corner case handling and
tests I've been adding recently for unexported method data.

For #15673

Change-Id: Ie0c7b03f2370bbe8508cdc5be765028f08000bd7
Reviewed-on: https://go-review.googlesource.com/23410
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/link: fix ARM gold linker check
Elias Naur [Wed, 25 May 2016 11:24:36 +0000 (13:24 +0200)]
cmd/link: fix ARM gold linker check

CL 23400 introduced a check to make sure the gold linker is used
on ARM host links. The check itself works, but the error checking
logic was reversed; fix it.

I manually verified that the check now correctly rejects host links
on my RPi2 running an ancient rasbian without the gold linker
installed.

Updates #15696

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

8 years agoruntime,runtime/cgo: save callee-saved FP register on arm
Elias Naur [Mon, 16 May 2016 13:51:07 +0000 (15:51 +0200)]
runtime,runtime/cgo: save callee-saved FP register on arm

Other GOARCHs already handle their callee-saved FP registers, but
arm was missing. Without this change, code using Cgo and floating
point code might fail in mysterious and hard to debug ways.

There are no floating point registers when GOARM=5, so skip the
registers when runtime.goarm < 6.

darwin/arm doesn't support GOARM=5, so the check is left out of
rt0_darwin_arm.s.

Fixes #14876

Change-Id: I6bcb90a76df3664d8ba1f33123a74b1eb2c9f8b2
Reviewed-on: https://go-review.googlesource.com/23140
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>