1
0
mirror of https://github.com/golang/go synced 2024-10-04 17:11:21 -06:00
Commit Graph

8451 Commits

Author SHA1 Message Date
Ian Lance Taylor
e0f986bf26 cmd/compile: avoid function literal name collision with "glob"
The compiler was treating all global function literals as occurring in a
function named "glob", which caused a symbol name collision when there
was an actual function named "glob".  Fixed by adding a period.

Fixes #16193.

Change-Id: I67792901a8ca04635ba41d172bfaee99944f594d
Reviewed-on: https://go-review.googlesource.com/24500
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-06-27 21:05:28 +00:00
Keith Randall
6effdd28de cmd/compile: keep heap pointer for escaping output parameters live
Make sure the pointer to the heap copy of an output parameter is kept
live throughout the function.  The function could panic at any point,
and then a defer could recover.  Thus, we need the pointer to the heap
copy always available so the post-deferreturn code can copy the return
value back to the stack.

Before this CL, the pointer to the heap copy could be considered dead in
certain situations, like code which is reverse dominated by a panic call.

Fixes #16095.

Change-Id: Ic3800423e563670e5b567b473bf4c84cddb49a4c
Reviewed-on: https://go-review.googlesource.com/24213
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-06-27 16:48:48 +00:00
Konstantin Shaposhnikov
e96b1ef99b cmd/vet: fix name check for examples in _test package
This fixes the obvious bug and makes go vet look for identifiers in foo
package when checking example names in foo_test package.

Note that for this check to work the foo package have to be
installed (using go install).

This commit however doesn't fix TestDivergentPackagesExamples test that
is not implemented correctly and passes only by chance.

Updates #16189

Change-Id: I5c2f675cd07e5b66cf0432b2b3e422ab45c3dedd
Reviewed-on: https://go-review.googlesource.com/24487
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-06-27 15:40:09 +00:00
Ian Lance Taylor
4fcb4eb279 cmd/pprof: don't use local symbolization for remote source
If we are using a remote source (a URL), and the user did not specify
the executable file to use, then don't try to use a local source.
This was misbehaving because the local symbolizer will not fail
if there is any memory map available, but the presence of a memory map
does not ensure that the files and symbols are actually available.

We still need a pprof testsuite.

Fixes #16159.

Change-Id: I0250082a4d5181c7babc7eeec6bc95b2f3bcaec9
Reviewed-on: https://go-review.googlesource.com/24464
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-25 00:36:40 +00:00
Ian Lance Taylor
83e839f86f cmd/pprof: ignore symbols with address 0 and size 0
Handling a symbol with address 0 and size 0, such as an ELF STT_FILE
symbols, was causing us to disassemble the entire program.  We started
adding STT_FILE symbols to help fix issue #13247.

Fixes #16154.

Change-Id: I174b9614e66ddc3d65801f7c1af7650f291ac2af
Reviewed-on: https://go-review.googlesource.com/24460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2016-06-24 22:52:15 +00:00
David Crawshaw
797dc58457 cmd/compile, etc: use tflag to optimize Name()==""
Improves JSON decoding benchmark:

	name                  old time/op    new time/op    delta
	CodeDecoder-8           41.3ms ± 6%    39.8ms ± 1%  -3.61%  (p=0.000 n=10+10)

	name                  old speed      new speed      delta
	CodeDecoder-8         47.0MB/s ± 6%  48.7MB/s ± 1%  +3.66%  (p=0.000 n=10+10)

Change-Id: I524ee05c432fad5252e79b29222ec635c1dee4b4
Reviewed-on: https://go-review.googlesource.com/24452
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-24 20:05:34 +00:00
David Crawshaw
e369490fb7 cmd/compile, etc: bring back ptrToThis
This was removed in CL 19695 but it slows down reflect.New, which ends
up on the hot path of things like JSON decoding.

There is no immediate cost in binary size, but it will make it harder to
further shrink run time type information in Go 1.8.

Before

	BenchmarkNew-40         30000000                36.3 ns/op

After

	BenchmarkNew-40         50000000                29.5 ns/op

Fixes #16161
Updates #16117

Change-Id: If7cb7f3e745d44678f3f5cf3a5338c59847529d2
Reviewed-on: https://go-review.googlesource.com/24400
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-23 17:39:38 +00:00
Ian Lance Taylor
b31ec5c564 cmd/yacc: error rather than panic when TEMPSIZE is too small
I tried simply increasing the size of the slice but then I got an error
because NSTATES was too small. Leaving a real fix for after 1.7.

Update #16144.

Change-Id: I8676772cb79845dd4ca1619977d4d54a2ce6de59
Reviewed-on: https://go-review.googlesource.com/24321
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-23 04:29:35 +00:00
Keith Randall
0dae2fd149 cmd/objdump: fix disassembly suffixes
MOVB $1, (AX) was being disassembled as MOVL $1, (AX).

Use the memory size to override the standard size.
Fix the tests.

Fixes #15922

Change-Id: If92fe74c33a21e5427c8c5cc97dd15e087edb860
Reviewed-on: https://go-review.googlesource.com/23608
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-23 02:28:18 +00:00
Alan Donovan
4764d6fd6e cmd/vet/internal/cfg: don't crash on malformed goto statement
Change-Id: Ib285c02e240f02e9d5511bd448163ec1d4e75516
Reviewed-on: https://go-review.googlesource.com/24323
Reviewed-by: Rob Pike <r@golang.org>
2016-06-22 17:09:26 +00:00
Alan Donovan
f2c13d713d cmd/vet: fix a crash in lostcancel check
Fixes issue 16143

Change-Id: Id9d257aee54d31fbf0d478cb07339729cd9712c0
Reviewed-on: https://go-review.googlesource.com/24325
Reviewed-by: Rob Pike <r@golang.org>
2016-06-22 16:57:45 +00:00
Robert Griesemer
1f446432dd cmd/compile: fix error msg mentioning different packages with same name
This is a regression from 1.6. The respective code in importimport
(export.go) was not exactly replicated with the new importer. Also
copied over the missing cyclic import check.

Added test cases.

Fixes #16133.

Change-Id: I1e0a39ff1275ca62a8054874294d400ed83fb26a
Reviewed-on: https://go-review.googlesource.com/24312
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
2016-06-22 00:12:55 +00:00
Alan Donovan
b65cb7f198 cmd/vet: -lostcancel: check for discarded result of context.WithCancel
The cfg subpackage builds a control flow graph of ast.Nodes.
The lostcancel module checks this graph to find paths, from a call to
WithCancel to a return statement, on which the cancel variable is
not used.  (A trivial case is simply assigning the cancel result to
the blank identifier.)

In a sample of 50,000 source files, the new check found 2068 blank
assignments and 118 return-before-cancel errors.  I manually inspected
20 of the latter and didn't find a single false positive among them.

Change-Id: I84cd49445f9f8d04908b04881eb1496a96611205
Reviewed-on: https://go-review.googlesource.com/24150
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-06-21 14:58:33 +00:00
qeed
d282427248 cmd/cgo: error, not panic, if not enough arguments to function
Fixes #16116.

Change-Id: Ic3cb0b95382bb683368743bda49b4eb5fdcc35c0
Reviewed-on: https://go-review.googlesource.com/24286
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-21 04:32:04 +00:00
Ian Lance Taylor
252eda470a cmd/pprof: don't use offset if we don't have a start address
The test is in the runtime package because there are other tests of
pprof there. At some point we should probably move them all into a pprof
testsuite.

Fixes #16128.

Change-Id: Ieefa40c61cf3edde11fe0cf04da1debfd8b3d7c0
Reviewed-on: https://go-review.googlesource.com/24274
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-21 01:44:38 +00:00
Andrew Gerrand
109823ec93 cmd/go: for generate, use build context values for GOOS/GOARCH
Fixes #16120

Change-Id: Ia352558231e00baab5c698e93d7267564c07ec0c
Reviewed-on: https://go-review.googlesource.com/24242
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-20 23:55:43 +00:00
Michael Munday
f3d54789f7 cmd/compile: use power5 instructions for uint64 to float casts
Use the same technique as mips64 for these casts (CL 22835).

We could use the FCFIDU instruction for ppc64le however it seems
better to keep it the same as ppc64 for now.

Updates #15539, updates #16004.

Change-Id: I550680e485327568bf3238c4615a6cc8de6438d7
Reviewed-on: https://go-review.googlesource.com/24191
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Michael Munday <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-17 19:15:29 +00:00
Austin Clements
79f2f008a3 cmd/dist: make zosarch.go deterministic
Currently zosarch.go is written out in non-deterministic map order.
Sort the keys and write it out in sorted order to make the generated
file contents deterministic.

Change-Id: Id490f0e8665a2c619c5a7a00a30f4fc64f333258
Reviewed-on: https://go-review.googlesource.com/24174
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-16 19:32:33 +00:00
David Crawshaw
af0fc83985 cmd/compile, etc: handle many struct fields
This adds 8 bytes of binary size to every type that has methods. It is
the smallest change I could come up with for 1.7.

Fixes #16037

Change-Id: Ibe15c3165854a21768596967757864b880dbfeed
Reviewed-on: https://go-review.googlesource.com/24070
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-14 15:32:34 +00:00
Ian Lance Taylor
0deb49f9c0 cmd/go: include .syso files even if CGO_ENABLED=0
A .syso file may include information that should go into the object file
that is not object code, and should be included even if not using cgo.
The example in the issue is a Windows manifest file.

Fixes #16050.

Change-Id: I1f4f3f80bb007e84d153ca2d26e5919213ea4f8d
Reviewed-on: https://go-review.googlesource.com/24032
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2016-06-14 03:44:27 +00:00
Ian Lance Taylor
9273e25ecc cmd/go: remove obsolete comment referring to deleted parameter
The dir parameter was removed in https://golang.org/cl/5732045.

Fixes #15503.

Change-Id: I02a6d8317233bea08633715a095ea2514822032b
Reviewed-on: https://go-review.googlesource.com/24011
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-14 03:33:45 +00:00
Keith Randall
5701174c52 cmd/link: put padding between functions, not at the end of a function
Functions should be declared to end after the last real instruction, not
after the last padding byte. We achieve this by adding the padding while
assembling the text section in the linker instead of adding the padding
to the function symbol in the compiler. This change makes dtrace happy.

TODO: check that this works with external linking

Fixes #15969

Change-Id: I973e478d0cd34b61be1ddc55410552cbd645ad62
Reviewed-on: https://go-review.googlesource.com/24040
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-13 14:05:52 +00:00
David Chase
595426c0d9 cmd/compile: fix OASWB rewriting in racewalk
Special case for rewriting OAS inits omitted OASWB, added
that and OAS2FUNC.  The special case cannot be default case,
that causes racewalk to fail in horrible ways.

Fixes #16008.

Change-Id: Ie0d2f5735fe9d8255a109597b36d196d4f86703a
Reviewed-on: https://go-review.googlesource.com/23954
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-12 23:58:25 +00:00
Dmitri Shuralyov
2ba3d5fc96 cmd/go: remove invalid space in import comment docs
Generate package comment in alldocs.go using line comments rather than
general comments. This scales better, general comments cannot contain the
"*/" character sequence. Line comments do not have any restrictions on
the comment text that can be contained.

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

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

Fixes #16030.

Change-Id: I3c0bc9955e7c7603c3d1fb4878218b0719d02e04
Reviewed-on: https://go-review.googlesource.com/23968
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-12 04:13:07 +00:00
Ian Lance Taylor
fee02d270b cmd/go: clarify go get documentation
Make the documentation for `go get` match the documentation for `go
install`, since `go get` essentially invokes `go install`.

Update #15825.

Change-Id: I374d80efd301814b6d98b86b7a4a68dd09704c92
Reviewed-on: https://go-review.googlesource.com/23925
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-10 04:12:50 +00:00
Keith Randall
e3f1c66f31 cmd/compile: for tail calls in stubs, ensure args are alive
The generated code for interface stubs sometimes just messes
with a few of the args and then tail-calls to the target routine.
The args that aren't explicitly modified appear to not be used.
But they are used, by the thing we're tail calling.

Fixes #16016

Change-Id: Ib9b3a8311bb714a201daee002885fcb59e0463fa
Reviewed-on: https://go-review.googlesource.com/23960
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2016-06-09 19:32:51 +00:00
Ian Lance Taylor
1bdf1c3024 cmd/cgo: fix use of unsafe argument in new deferred function
The combination of https://golang.org/cl/23650 and
https://golang.org/cl/23675 did not work--they were tested separately
but not together.

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

No new test required--fixes broken build.

Change-Id: I5ea023c5aed71d70e57b11c4551242d3ef25986d
Reviewed-on: https://go-review.googlesource.com/23961
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2016-06-09 19:05:19 +00:00
Ian Lance Taylor
837984f372 cmd/cgo: use function arg type for _cgoCheckPointerN function
When cgo writes a _cgoCheckPointerN function to handle unsafe.Pointer,
use the function's argument type rather than interface{}. This permits
type errors to be detected at build time rather than run time.

Fixes #13830.

Change-Id: Ic7090905e16b977e2379670e0f83640dc192b565
Reviewed-on: https://go-review.googlesource.com/23675
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2016-06-09 16:02:03 +00:00
Ian Lance Taylor
763883632e cmd/go: only run TestGoGetHTTPS404 where it works
The test TestGoGetHTTPS404 downloads a package that does not build on
every OS, so change it to only run where the package builds. It's not
great for the test to depend on an external package, but this is an
improvement on the current situation.

Fixes #15644.

Change-Id: I1679cee5ab1e61a5b26f4ad39dc8a397fbc0da69
Reviewed-on: https://go-review.googlesource.com/23920
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-09 03:48:34 +00:00
Cherry Zhang
f3689d1382 cmd/compile: nilcheck interface value in go/defer interface call for SSA
This matches the behavior of the legacy backend.

Fixes #15975 (if this is the intended behavior)

Change-Id: Id277959069b8b8bf9958fa8f2cbc762c752a1a19
Reviewed-on: https://go-review.googlesource.com/23820
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-08 20:35:53 +00:00
Keith Randall
afad74ec30 cmd/compile: cgen_append can handle complex targets
Post-liveness fix, the slices on both sides can now be
indirects of & variables.  The cgen code handles those
cases just fine.

Fixes #15988

Change-Id: I378ad1d5121587e6107a9879c167291a70bbb9e4
Reviewed-on: https://go-review.googlesource.com/23863
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2016-06-08 00:01:09 +00:00
Keith Randall
2f088884ae cmd/compile: use fake package for allocating autos
Make sure auto names don't conflict with function names. Before this CL,
we confused name a.len (the len field of the slice a) with a.len (the function
len declared on a).

Fixes #15961

Change-Id: I14913de697b521fb35db9a1b10ba201f25d552bb
Reviewed-on: https://go-review.googlesource.com/23789
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-07 06:04:23 +00:00
Andrew Gerrand
27c5dcffef cmd/dist: use "set" instead of "export" in diagnostic message
On Windows, "export" doesn't mean anything, but Windows users are the
most likely to see this message.

Fixes #15977

Change-Id: Ib09ca08a7580713cacb65d0cdc43730765c377a8
Reviewed-on: https://go-review.googlesource.com/23840
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-07 04:31:29 +00:00
Mikio Hara
0326e28f17 Revert "cmd/go: re-enable TestCgoConsistentResults on solaris"
This reverts commit b89bcc1dae.

Change-Id: Ief2f317ffc175f7e6002d0c39694876f46788c69
Reviewed-on: https://go-review.googlesource.com/23744
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
2016-06-03 22:41:47 +00:00
Mikio Hara
b89bcc1dae cmd/go: re-enable TestCgoConsistentResults on solaris
Updates #13247.

Change-Id: If5e4c9f4db05f58608b0eeed1a2312a04015b207
Reviewed-on: https://go-review.googlesource.com/23741
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-03 22:18:16 +00:00
Ian Lance Taylor
7b48020cfe cmd/cgo: check pointers for deferred C calls at the right time
We used to check time at the point of the defer statement. This change
fixes cgo to check them when the deferred function is executed.

Fixes #15921.

Change-Id: I72a10e26373cad6ad092773e9ebec4add29b9561
Reviewed-on: https://go-review.googlesource.com/23650
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2016-06-03 20:51:39 +00:00
Stephen McQuay (smcquay)
adf261b7d6 cmd/go: match go-import package prefixes by slash
The existing implementation for path collision resolution would
incorrectly determine that:

    example.org/aa

collides with:

    example.org/a

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

Fixes: #15947

Change-Id: I18b3aaafbc787c81253203cf1328bb3c4420a0c4
Reviewed-on: https://go-review.googlesource.com/23732
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2016-06-03 19:47:37 +00:00
Ian Lance Taylor
6901b08482 cmd/link: avoid name collision with DWARF .def suffix
Adding a .def suffix for DWARF info collided with the DWARF info,
without the suffix, for a method named def. Change the suffix to ..def
instead.

Fixes #15926.

Change-Id: If1bf1bcb5dff1d7f7b79f78e3f7a3bbfcd2201bb
Reviewed-on: https://go-review.googlesource.com/23733
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-03 16:56:29 +00:00
Michael Hudson-Doyle
26849746c9 cmd/internal/obj, runtime: fixes for defer in 386 shared libraries
Any defer in a shared object crashed when GOARCH=386. This turns out to be two
bugs:

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

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

Fixes #15916

Change-Id: Ia0d09b69ec272a176934176b8eaef5f3bfcacf04
Reviewed-on: https://go-review.googlesource.com/23623
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-03 02:50:27 +00:00
Andrew Gerrand
5799973c3e cmd/go: fix staleness test for releases, also deflake it
Fixes #15933

Change-Id: I2cd6365e6d0ca1cafdc812fbfaaa55aa64b2b289
Reviewed-on: https://go-review.googlesource.com/23731
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-03 02:46:58 +00:00
Elias Naur
14968bc1e5 cmd/dist: skip an unsupported test on darwin/arm
Fixes the darwin/arm builder (I hope)

Change-Id: I8a3502a1cdd468d4bf9a1c895754ada420b305ce
Reviewed-on: https://go-review.googlesource.com/23684
Run-TryBot: Elias Naur <elias.naur@gmail.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-06-02 14:02:07 +00:00
Elias Naur
42c51debe8 misc/cgo/test,cmd/dist: enable (more) Cgo tests on iOS
For #15919

Change-Id: I9fc38d9c8a9cc9406b551315e1599750fe212d0d
Reviewed-on: https://go-review.googlesource.com/23635
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-02 10:09:12 +00:00
Michael Hudson-Doyle
d25c3eadea cmd/compile: do not generate tail calls when dynamic linking on ppc64le
When a wrapper method calls the real implementation, it's not possible to use a
tail call when dynamic linking on ppc64le. The bad scenario is when a local
call is made to the wrapper: the wrapper will call the implementation, which
might be in a different module and so set the TOC to the appropriate value for
that module. But if it returns directly to the wrapper's caller, nothing will
reset it to the correct value for that function.

Change-Id: Icebf24c9a2a0a9a7c2bce6bd6f1358657284fb10
Reviewed-on: https://go-review.googlesource.com/23468
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-02 02:34:01 +00:00
Andrew Gerrand
3c6b6684ce api: promote next.txt to go1.7.txt and update api tool
Change-Id: Idb348be00f949da553aa6aab62836f59dfee298d
Reviewed-on: https://go-review.googlesource.com/23671
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Andrew Gerrand <adg@golang.org>
2016-06-02 00:22:03 +00:00
Elias Naur
6de014b9e2 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>
2016-06-01 22:06:51 +00:00
Robert Griesemer
bbd1dcdf7d 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>
2016-06-01 21:32:46 +00:00
Keith Randall
52fe472472 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>
2016-06-01 14:14:13 +00:00
David du Colombier
e29e0ba19a 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>
2016-06-01 13:33:43 +00:00
Michael Hudson-Doyle
2885e07c25 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>
2016-06-01 03:55:09 +00:00
Keith Randall
e106122200 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>
2016-06-01 00:06:00 +00:00