1
0
mirror of https://github.com/golang/go synced 2024-11-14 15:00:27 -07:00
Commit Graph

10435 Commits

Author SHA1 Message Date
Jamie Kerr
0593ad1e23 cmd/compile: fix comment typo
Change-Id: If581bd4e9d9b4421e2ae20582c596fccb73d9aed
Reviewed-on: https://go-review.googlesource.com/48866
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-15 18:36:07 +00:00
Ian Lance Taylor
2a2a283418 cmd/dist: don't run moved_goroot test on android, iOS, Plan 9
Fails on iOS because CC_FOR_TARGET points to clangwrap.sh in the
original GOROOT. We could fix that but it doesn't seem worth it.

Fails on Android with "exec format error". I'm not sure why but I
doubt it is interesting.

Fails on Plan 9 because the original GOROOT is being preserved in some
unknown way. This is issue #21016.

Updates #21016

Change-Id: I4e7115d734fc7bf21e5a2ba18fb6ad0bfa31c735
Reviewed-on: https://go-review.googlesource.com/48650
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-15 14:13:24 +00:00
Ian Lance Taylor
7914369e64 cmd/go: update BuildContext.GOROOT and build.Tooldir with computed GOROOT
This is necessary to make a relocated GOROOT work correctly.

Fixes #20997

Change-Id: I18624bd2e109721066cd9e4a887a12583ab79f5d
Reviewed-on: https://go-review.googlesource.com/48550
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-14 20:07:08 +00:00
David Chase
9664bc1d1f cmd/compile: fix phi-function updates for preemptible loops
Previous code failed to account for particular control flow
involving nested loops when updating phi function inputs.
Fix involves:
1) remove incorrect shortcut
2) generate a "better" order for children in dominator tree
3) note inner-loop updates and check before applying
   outer-loop updates.

Fixes #20675.

Change-Id: I2fe21470604b5c259e777ad8b15de95f7706894d
Reviewed-on: https://go-review.googlesource.com/45791
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-07-14 15:54:13 +00:00
Ian Lance Taylor
5bcfd88472 testing: roll back CL 44352 (show in-progress tests upon SIGINT)
CL 44352 changed the behavior of SIGINT, which can break tests that
themselves use SIGINT.  I think we can only implement this if the
testing package has a way to know whether the code under test is using
SIGINT, but os/signal does not provide an API for that.  Roll back for
1.9 and think about this again for 1.10.

Updates #19397

Change-Id: I021c314db2b9d0a80d0088b120a6ade685459990
Reviewed-on: https://go-review.googlesource.com/48370
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-13 16:01:49 +00:00
Alessandro Arzilli
6f83b75be2 cmd/compile: fix lexical scope of escaped variables
When a local variable is moved to the heap the declaration position
should be preserved so that later on we can assign it to the correct
DW_TAG_lexical_block.

Fixes #20959

Change-Id: I3700ef53c68ccd506d0633f11374ad88a52b2898
Reviewed-on: https://go-review.googlesource.com/47852
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-07-10 20:09:00 +00:00
Michael Pratt
123fd4640a cmd/link: skip R_ADDR relocs in .rela.plt for internal PIE
ld.addpltsym adds an R_X86_64_JMP_SLOT dynamic relocation to .rela.plt
and uses Addaddrplus to reference the GOT in Elf64_Rela.r_offset.

Addaddrplus results in an R_ADDR relocation, which here we transform
into an R_X86_64_64 dynamic relocation. This is wrong for several
reasons:

1. .rela.plt is not a writable, relro section. It is mapped read-only,
   causing the dynamic linker to segfault when it tried to handle the
   relocation. This was the immediate cause of internal PIE cgo
   crashes.

2. Relocations targetting other reloc sections are, as far as I can
   tell, undefined behavior in the ELF spec and are unlikely to be a
   good idea.

3. Even if the relocation did work, it isn't what we want. The
   relocation, if successfully handled, would have put an absolute
   address as the JMP_SLOT offset, but it should be the offset from the
   beginning of the binary, just like any other relocation. What we want
   is a statically resolved R_ADDR relocation, just as is used below for
   the R_X86_64_64 relocation.

Skipping the .rela.plt allows reloc() to handle these R_ADDR
relocations.

With this CL, internal PIE cgo binaries work.

Updates #18968

Change-Id: Ie74e6fe249e88150baa0e340b1cb128cf7f28673
Reviewed-on: https://go-review.googlesource.com/47837
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-07-09 19:23:41 +00:00
Austin Clements
5d16f9751a Revert "cmd/dist: disable plugin test on linux-arm with GOARM=5"
This reverts commit 168eb9cf33.

CL 47831 fixes the issue with plugins on ARMv5, so we can re-enable the test.

Updates #19674.

Change-Id: Idcb29f93ffb0460413f1fab5bb82fa2605795038
Reviewed-on: https://go-review.googlesource.com/47834
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-07 20:24:44 +00:00
Brad Fitzpatrick
39ed6b14b4 cmd/doc: print Go syntax when printing struct.field docs
Fixes #20928

Change-Id: I7f7aafb8ff4b5deb50c286a9ae81c34ee85e56a9
Reviewed-on: https://go-review.googlesource.com/47730
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-06 21:57:52 +00:00
Russ Cox
e7f86341fe cmd/go: fix docs for -timeout
The text before CL 45816 was:

	-timeout t
		If a test runs longer than t, panic.
		The default is 10 minutes (10m).

CL 45816 was supposed to be about clarifying test vs test binary,
and it did add the clarification of referring to "duration d",
but it also introduced incorrect text about timeout 0.

The new text in this CL preserves the good change and
eliminates the incorrect one:

	-timeout d
		If a test binary runs longer than duration d, panic.
		The default is 10 minutes (10m).

For #14780.

Change-Id: I4f79d6e48ed9295bc9f34a36aa90d3b03b40d7f5
Reviewed-on: https://go-review.googlesource.com/47571
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-06 04:32:24 +00:00
Ben Shi
ef26021d30 cmd/internal/obj/arm: check illegal base registers in ARM instructions
Wrong instructions "MOVW 8(F0), R1" and "MOVW R0<<0(F1), R1"
are silently accepted, and all Fx are treated as Rx.

The patch checks all those illegal base registers.

fixes #20724

Change-Id: I05d41bb43fe774b023205163b7daf4a846e9dc88
Reviewed-on: https://go-review.googlesource.com/46132
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-06-30 19:09:44 +00:00
fanzha02
990dac2723 cmd/internal/obj/arm64: fix assemble LDXP bug
The current code calculates register number incorrectly.

The fix corrects the register number calculation.

Add cases created by decoder to test assembler.

Fixes #20697
Fixes #20723

Change-Id: I73ac153df9ea9f51c43a5104828d7a5389551c92
Reviewed-on: https://go-review.googlesource.com/45850
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-06-30 18:24:58 +00:00
Robert Griesemer
87c4a04b80 cmd/vet/all: in case of vet panic, don't filter stacktrace
Fixes #20839.

Change-Id: I125460c5da09b7fa0cf470ff5be436f8d650cde7
Reviewed-on: https://go-review.googlesource.com/47253
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-29 23:22:38 +00:00
Robert Griesemer
e6d9eda2fc cmd/vet/all: fix print statement, add platform information
Change-Id: Ibbb89c01f3e812a0602961f959672fcb6523449b
Reviewed-on: https://go-review.googlesource.com/47031
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-28 20:29:45 +00:00
Cherry Zhang
c920fa537f cmd/compile: fix slice-in-bound check on amd64p32
Should use CMPL instead of CMPQ.

Fixes #20811.

Change-Id: I610d487949c2c8a08b3743656149069d931a51bb
Reviewed-on: https://go-review.googlesource.com/46870
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-28 16:20:53 +00:00
Hiroshi Ioka
289a8719ce cmd/cgo: unwrap typedef-chains before type checking
clang can emit some dwarf.VoidType which are wrapped by multiple
dwarf.TypedefType. We need to unwrap those before further processing.

Fixes #20129

Change-Id: I671ce6aef2dc7b55f1a02aec5f9789ac1b369643
Reviewed-on: https://go-review.googlesource.com/44772
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-27 23:02:34 +00:00
Matthew Dempsky
f62c608abb cmd/compile: suppress errors after "cannot assign to X"
If the LHS is unassignable, there's no point in trying to make sure
the RHS can be assigned to it or making sure they're realizable
types. This is consistent with go/types.

In particular, this prevents "1 = 2" from causing a panic when "1"
still ends up with the type "untyped int", which is not realizable.

Fixes #20813.

Change-Id: I4710bdaac2e375ef12ec29b888b8ac84fb640e56
Reviewed-on: https://go-review.googlesource.com/46835
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-06-27 20:29:33 +00:00
Brad Fitzpatrick
81ed9ca1d4 cmd/go: skip broken TestExecutableGOROOT/RelocatedExe
Test just doesn't work.

Updates #20284

Change-Id: I31c3f771e68dcdc471767594a1467e19fbf5fe88
Reviewed-on: https://go-review.googlesource.com/46830
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@google.com>
2017-06-27 19:00:52 +00:00
Dong-hee Na
5dafa91917 cmd/go: update helpdoc.go about '-buildmode'
After https://golang.org/cl/46421 is landed.
helpdoc.go should be updated that -buildmode=c-shared
requires only one main package.

Fixes #15082

Change-Id: I30a0ee956e6c4655c975ecdaa905887bd474952c
Reviewed-on: https://go-review.googlesource.com/46810
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-27 18:53:08 +00:00
Brad Fitzpatrick
eab99a8d54 cmd/go: add more info in t.Fatal message
Updates #20284

Change-Id: I4d55d6adec4e8efb54285ca27bb4fa39c76582c3
Reviewed-on: https://go-review.googlesource.com/46719
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-06-26 21:12:22 +00:00
Robert Griesemer
6d594342c6 cmd/compile: use correct variable when setting up dummy CallStmt in error
Fixes crash when printing a related error message later on.

Fixes #20789.

Change-Id: I6d2c35aafcaeda26a211fc6c8b7dfe4a095a3efe
Reviewed-on: https://go-review.googlesource.com/46713
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-26 18:39:37 +00:00
Ben Shi
3785457c76 cmd/internal/obj/arm: fix wrong encoding of MULBB
"MULBB R1, R2, R3" is encoded to 0xe163f182, which should be
0xe1630182.

This patch fix it.

fix #20764

Change-Id: I9d3c3ffa40ecde86638e5e083eacc67578caebf4
Reviewed-on: https://go-review.googlesource.com/46491
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-06-23 18:08:20 +00:00
Russ Cox
c23948a2b8 cmd/go: fix TestExecutableGOROOT when GOROOT_FINAL is set
If GOROOT_FINAL was set during the build, the default GOROOT
will not be testGOROOT. Determine the default GOROOT by reading
the right source file instead of guessing. (GOROOT_FINAL may no
longer be set when the test is actually run.)

Also refactor a bit.

Fixes #20284.

Change-Id: I2274595a235bee10c3f3a5ffecf4bb976f4d9982
Reviewed-on: https://go-review.googlesource.com/46428
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-23 15:35:55 +00:00
Russ Cox
3445ece212 cmd/go: be more precise when a directory cannot be built
Maybe there are no Go files at all.
Maybe they are all excluded by build constraints.
Maybe there are only test Go files.
Be specific.

Fixes #17008.
Fixes parts of #20760.

Change-Id: If6ac82ba0ed437772e76e06763263747d3bc4f65
Reviewed-on: https://go-review.googlesource.com/46427
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-23 15:02:32 +00:00
Russ Cox
f3e82e045e cmd/go: report possibly-relevant ignored symlinks during pattern match
We can't follow symlinks for fear of directory cycles and other problems,
but we can at least notice potentially-relevant symlinks that are being
ignored and report them.

Fixes #17662.

Change-Id: I1fce00bd5b80ea8df45dac8b61bfa08076ec5f4b
Reviewed-on: https://go-review.googlesource.com/46425
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-23 15:01:38 +00:00
Russ Cox
78a11c21ab cmd/go: detect case-insensitive import path collision
We already detect this collision when both imports are used
anywhere in a single program. Also detect it when they are in
different targets being processed together.

Fixes #20264.

Change-Id: I5d3c822aae136053fbcb5ed167e1d67f9b847a0f
Reviewed-on: https://go-review.googlesource.com/46424
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-23 15:01:24 +00:00
Ben Shi
e00a38c89a cmd/internal/obj/arm: fix setting U bit in shifted register offset of MOVBS
"MOVBS.U R0<<0(R1), R2" is assembled to 0xe19120d0 (ldrsb r2, [r1, r0]),
but it is expected to be 0xe11120d0 (ldrsb r2, [r1, -r0]).

This patch fixes it and adds more encoding tests.

fixes #20701

Change-Id: Ic1fb46438d71a978dbef06d97494a70c95fcbf3a
Reviewed-on: https://go-review.googlesource.com/45996
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-06-23 14:29:57 +00:00
Russ Cox
a6df299e89 cmd/go: detect Go assembly before assembling with gcc
Avoids confusing errors from the GNU assembler
processing Go assembly source code.

Fixes #19448.

Change-Id: Ic2c68b2521847cca5a3d078a092e5c60ec340840
Reviewed-on: https://go-review.googlesource.com/46423
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-23 00:21:06 +00:00
Russ Cox
53e4b8fc02 cmd/go: require -buildmode=c-shared to take one main package
The current behavior is to filter out the non-main packages silently,
which is confusing if there are only non-main packages.
Instead, report an error unless it's used with a single main package.

To be clear, I don't really know what I'm doing.
It might be that multiple main packages are allowed, or even
that we do want the filtering, but all.bash passes with this change,
so I am taking that as a sign that we don't need that extra flexibility.

Fixes #15082.

Change-Id: I984d0f444a01c0ee0c3cd6646a75527ea99a9ebe
Reviewed-on: https://go-review.googlesource.com/46421
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-23 00:20:57 +00:00
Robert Griesemer
47e659b01f cmd/compile: fix array slice expression bounds check
Fixes #20749.

Change-Id: Ic6a7edc858575c4cb8b2e2ca97ee0c4b69f22c27
Reviewed-on: https://go-review.googlesource.com/46466
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-22 23:31:45 +00:00
Russ Cox
1080cece5a cmd/go: read URL not Repository Root from svn info
This makes custom import path checks work even when the
custom import metadata directs checking out a subtree
of the subversion repository.

(Git and Mercurial allow no such thing, so they are unaffected.)

Fixes #20731.

Change-Id: I635f3a2037d69a87c6dac7b08b0a0d8266abd250
Reviewed-on: https://go-review.googlesource.com/46417
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-22 16:47:27 +00:00
David Chase
0b6fbaae6e cmd/compile: make loop guard+rotate conditional on GOEXPERIMENT
Loops of the form "for i,e := range" needed to have their
condition rotated to the "bottom" for the preemptible loops
GOEXPERIMENT, but this caused a performance regression
because it degraded bounds check removal.  For now, make
the loop rotation/guarding conditional on the experiment.

Fixes #20711.
Updates #10958.

Change-Id: Icfba14cb3b13a910c349df8f84838cf4d9d20cf6
Reviewed-on: https://go-review.googlesource.com/46410
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-06-21 22:07:33 +00:00
Mikio Hara
7b659eb155 all: gofmt
Change-Id: I2d0439a9f068e726173afafe2ef1f5d62b7feb4d
Reviewed-on: https://go-review.googlesource.com/46190
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-21 03:14:30 +00:00
Alberto Donizetti
5a5ac34133 Revert "cmd/vendor/github.com/google/pprof: refresh from upstream"
This reverts commit 3d13b5e00c.

Reason for revert: the new TestHttpsInsecure test breaks two darwin builders, the android builders, and one plan9 builder.

Change-Id: I09158e7d1bd2b3ffda57e7f2350f34eb9b62e784
Reviewed-on: https://go-review.googlesource.com/46158
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-20 19:46:11 +00:00
Alberto Donizetti
3d13b5e00c cmd/vendor/github.com/google/pprof: refresh from upstream
Updating to commit fffc5831a499a958516664a34cb7ba2b9e228793
from github.com/google/pprof

Fixes #19380

Change-Id: I7a0c64101f42b494c4a469c41628374272eccf95
Reviewed-on: https://go-review.googlesource.com/46155
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-20 18:31:06 +00:00
Russ Cox
a2a3ace51a testing: harmonize handling of prefix-matched benchmarks
If you have BenchmarkX1 with sub-benchmark Y
and you have BenchmarkX2 with no sub-benchmarks,
then

	go test -bench=X/Y

runs BenchmarkX1 once with b.N=1 (to find out about Y)
and then not again, because it has sub-benchmarks,
but arguably also because we're interested in Y.

In contrast, it runs BenchmarkX2 in full, even though clearly
that is not relevant to the match X/Y. We do have to run X2
once with b.N=1 to probe for having X2/Y, but we should not
run it with larger b.N.

Fixes #20589.

Change-Id: Ib86907e844f34dcaac6cd05757f57db1019201d0
Reviewed-on: https://go-review.googlesource.com/46031
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2017-06-20 14:19:05 +00:00
Robert Griesemer
6c2458e72d cmd/compile: permit Unicode spaces in (expanded) package paths
This doesn't change the existing restriction with disallows
spaces in import paths (as found in an import declaration).
It simply permits packages to be under a directory name that
may contain spaces.

Verified manually that it works. This could use a test, but the
change is trivial. We also can't use the existing test framework
(under test/) because the way those tests are run with test/run.go,
the mechanims for compiling a directory, even if it contains blanks
it its name, does't produce compiler paths with blanks
(the compilation is local).

Fixes #20306.

Change-Id: I6cbffb86c3394347897c3c94b110da0aadc5bfdf
Reviewed-on: https://go-review.googlesource.com/46001
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2017-06-19 16:59:58 +00:00
Russ Cox
10d855198c cmd/go: clarify test -run and -bench pattern matching
Make it clearer that -test=X/Y runs all the tests matching X,
even if they don't have sub-tests matching Y.

Fixes #20589.

Change-Id: Ic27e89e748d60f67b50c68445ec0480066bdf207
Reviewed-on: https://go-review.googlesource.com/46030
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-16 15:31:09 +00:00
Robert Griesemer
ebcdda4732 cmd/compile: fix crash in importer when running in debug mode
Verified by manually enabling debug mode and running make.bash.

Fixes #20684.

Change-Id: I041f2ca6ef1d4198815724d98f61511072d63581
Reviewed-on: https://go-review.googlesource.com/45971
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-15 22:27:53 +00:00
Matthew Dempsky
eb86abaa36 cmd/compile: better error for malformed packages
Fixes #14270.

Change-Id: Iaf2496a24b1aba443391b90951cef472add73f13
Reviewed-on: https://go-review.googlesource.com/45950
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-15 21:24:33 +00:00
Marko Mudrinic
6ce5067117 cmd/go: improve documentation on defaults for get
The existing docs states that, get looks for a branch or tag
that matches the locally installed version of Go.
First, this is only working for "go1", so it could be confusing.
Second, "If no such version exists it retrieves the most recent
version of the package". It's more the default branch, by git defaults,
rather than most recent version.

This should address the potential unclear parts.

Fixes #20320

Change-Id: Id7d727d88dc350c9902974b64fa28c3766f7e245
Reviewed-on: https://go-review.googlesource.com/45890
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-15 21:20:46 +00:00
Matthew Dempsky
8d2b3bb7b1 Revert "cmd/compile: skip reexporting types in reexportdep"
This reverts commit edad59cfae.

Fixes #20682.

Change-Id: If998c8b4bf177d5da9e26f75579bd5497ec86d38
Reviewed-on: https://go-review.googlesource.com/45911
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-06-15 18:43:48 +00:00
Kale Blankenship
e7c650bca5 testing: clarify -timeout flag
Fixes #20090

Change-Id: I881607e55cd946a703e74a7d8ae2bbde67546510
Reviewed-on: https://go-review.googlesource.com/45816
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-15 05:57:29 +00:00
Matthew Dempsky
ff0748670c cmd/compile: fix exporting of function bodies
Before CL 36170, we identified all function bodies that needed to be
exported before writing any export data.

With CL 36170, we started identifying additional functions while
exporting function bodies. As a consequence, we cannot use a
range-based for loop for iterating over function bodies anymore.

Fixes #18895.

Change-Id: I9cbefa8d311ca8c9898c8272b2ac365976b02396
Reviewed-on: https://go-review.googlesource.com/45817
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-06-15 04:17:30 +00:00
Keith Randall
79d05e75ca runtime: restore arm assembly stubs for div/mod
These are used by DIV[U] and MOD[U] assembly instructions.
Add a test in the stdlib so we actually exercise linking
to these routines.

Update #19507

Change-Id: I0d8e19a53e3744abc0c661ea95486f94ec67585e
Reviewed-on: https://go-review.googlesource.com/45703
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-06-15 03:51:03 +00:00
Kale Blankenship
90b7058ec4 cmd/pprof: restore printing descriptive errors from net/http/pprof endpoints
Restores functionality added in https://golang.org/cl/35564/ which was
lost in https://golang.org/cl/36798/ by the addition of the custom
fetcher to src/cmd/pprof/pprof.go. The custom fetcher overrides the
upstream default.

Change-Id: Ic71e5e475d043276d916298ab5acb5c9b9ad063e
Reviewed-on: https://go-review.googlesource.com/45812
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-15 02:14:24 +00:00
Robert Griesemer
cabf622da8 cmd/compile: fix detection of calls to reflect.Method
The existing code used Type.String() to obtain the name of a type;
specifically type reflect.Method in this case. However, Type.String()
formatting is intended for error messages and uses the format
pkgpath.name instead of pkgname.name if a package (in this case
package reflect) is imported multiple times. As a result, the
reflect.Method type detection failed under peculiar circumstances
(see the included test case).

Thanks to https://github.com/ericlagergren for tracking down
an easy way to make the bug disappear (which in turn directly
led to the underlying cause).

Fixes #19028.

Change-Id: I1b9c5dfd183260a9be74969fe916a94146fc36da
Reviewed-on: https://go-review.googlesource.com/45777
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-06-14 21:57:56 +00:00
Brad Fitzpatrick
952ecbe0a2 cmd/go: disable tool version check during bootstrap
The check that the go tool version matched the go compiler version was
too aggressive and didn't cover the bootstrapping case with make.bash.

We never noticed because we never had a VERSION file in place.

Repro:

$ echo "go1.9beta1" > $GOROOT/VERSION
$ cd $GOROOT/src
$ ./make.bash

No test, because x/build/cmd/release catches it.

Updates #19064
Fixes #20674

Change-Id: Ibdd7a92377f4cc77d71ed548f02d48bde6550f67
Reviewed-on: https://go-review.googlesource.com/45778
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-06-14 21:44:01 +00:00
Chris Broadfoot
cf7347a973 api: promote next to go1.9
Change-Id: I27aa87607aa82b400411a60c6bdb6f9a42ff97c1
Reviewed-on: https://go-review.googlesource.com/45776
Run-TryBot: Chris Broadfoot <cbro@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-14 21:07:10 +00:00
Keith Randall
4958f9e2fe runtime: remove unused arm assembly for div/mod
Also add runtime· prefixes to the code that is still used.

Fixes #19507

Change-Id: Ib6da6b2a9e398061d3f93958ee1258295b6cc33b
Reviewed-on: https://go-review.googlesource.com/45699
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-14 18:00:26 +00:00