1
0
mirror of https://github.com/golang/go synced 2024-11-08 08:26:10 -07:00
Commit Graph

11222 Commits

Author SHA1 Message Date
Ian Lance Taylor
943e2635b3 cmd/go: remove file created by test
The file cmd/go/testdata/src/testcache/script.sh was accidentally
committed with CL 83256. Sorry about that.

Updates #22593

Change-Id: Id8f07587ea97015ed75439db220560a5446e53e6
Reviewed-on: https://go-review.googlesource.com/83395
Reviewed-by: Russ Cox <rsc@golang.org>
2017-12-12 04:54:20 +00:00
Ian Lance Taylor
1055dfce40 cmd/go: remove script.sh in TestTestCacheInputs
Updates #22593

Change-Id: I76e52dc8b874da13ae9e2d80e5c0d6d8424b67db
Reviewed-on: https://go-review.googlesource.com/83257
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-11 22:39:08 +00:00
Ian Lance Taylor
63e29ad1f7 cmd/go: don't pass -test.testlogfile on NaCl
It causes every test to fail as the log file is on the local file system,
not the NaCl file system.

Updates #22593

Change-Id: Iee3d8307317bd792c9c701baa962ebbbfa34c147
Reviewed-on: https://go-review.googlesource.com/83256
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-11 22:35:22 +00:00
Andrew Bonventre
43123903ca cmd/api: don’t rely on hardcoded go versions
Instead of requiring that cmd/api/run.go be edited upon each
release to include the next Go version number, look in $GOROOT/api
for files with the prefix go1* and use those instead to perform
API checks.

Change-Id: I5d9407f2bd368ff5e62f487cccdd245641ca9c9b
Reviewed-on: https://go-review.googlesource.com/83355
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-11 22:28:37 +00:00
Russ Cox
29be20a111 cmd/go: invalidate cached test results if env vars or files change
When we write a cached test result, we now also write a log of the
environment variables and files inspected by the test run,
along with a hash of their content. Before reusing a cached test result,
we recompute the hash of the content specified by the log, and only
use the result if that content has not changed.

This makes test caching behave correctly for tests that consult
environment variables or stat or read files or directories.

Fixes #22593.

Change-Id: I8608798e73c90e0c1911a38bf7e03e1232d784dc
Reviewed-on: https://go-review.googlesource.com/81895
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-11 19:08:32 +00:00
Matthew Dempsky
840fad13ec cmd/compile: fix unsafe.Pointer liveness for Syscall-like functions
The package unsafe docs say it's safe to convert an unsafe.Pointer to
uintptr in the argument list to an assembly function, but it was
erroneously only detecting normal pointers converted to unsafe.Pointer
and then to intptr.

Fixes #23051.

Change-Id: Id1be19f6d8f26f2d17ba815191717d2f4f899732
Reviewed-on: https://go-review.googlesource.com/82817
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-08 21:34:24 +00:00
Keith Randall
25363de226 doc: add doc about C types that we map to uintptr instead of ptr
Update #22906
Update #21897

Change-Id: I73709b2fdac6981d4bc2f7dab0767f2dd7be3be5
Reviewed-on: https://go-review.googlesource.com/82917
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-08 16:54:20 +00:00
Keith Randall
36aa2b036d cmd/cgo: make JNI's jobject type map to uintptr in Go
The jobject type is declared as a pointer, but some JVMs
(Dalvik, ART) store non-pointer values in them. In Go, we must
use uintptr instead of a real pointer for these types.

This is similar to the CoreFoundation types on Darwin which
were "fixed" in CL 66332.

Update #22906
Update #21897

RELNOTE=yes

Change-Id: I0d4c664501d89a696c2fb037c995503caabf8911
Reviewed-on: https://go-review.googlesource.com/81876
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-08 16:13:14 +00:00
Keith Randall
4c800f03c9 cmd/compile: fix large load/store offsets on 386
Pointer arithemetic is done mod 2^32 on 386, so we can just
drop the high bits of any large constant offsets.

The bounds check will make sure wraparounds are never observed.

Fixes #21655

Change-Id: I68ae5bbea9f02c73968ea2b21ca017e5ecb89223
Reviewed-on: https://go-review.googlesource.com/82675
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-12-08 03:53:18 +00:00
Than McIntosh
692f2e9c44 cmd/compile: fix bug in logic for computing var abstract origins
The DWARF inline info generation code was using file/line/column (from
src.Pos) as a means of matching up pre- and post-optimization variable
nodes. This turns out to be problematic since it looks as though
distinct formals on the same line can be assigned the same column
number. Work around this issue by adding variable names to the
disambiguation code. Added a testpoint to the linker DWARF test that
checks to make sure each abstract origin offset of distinct within a
given DWARF DW_AT_inlined_routine body.

Fixes #23020.

Change-Id: Ie09bbe01dc60822d84d4085547b138e644036fb3
Reviewed-on: https://go-review.googlesource.com/82396
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-12-07 17:03:05 +00:00
Andrew Bonventre
8b13988e40 api: promote next to go1.10
Change-Id: I2a4347540ecb94a9f124a228dc31452620ab0645
Reviewed-on: https://go-review.googlesource.com/82335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-07 15:44:34 +00:00
Ian Lance Taylor
44f241be8b cmd/dist: only test SWIG if we have a new enough version
Fixes #22858

Change-Id: I0478d5609e381f01c7345e7f53c24af05d7f78ad
Reviewed-on: https://go-review.googlesource.com/82415
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-07 15:40:28 +00:00
Mikio Hara
3d3b8cc477 cmd/vendor/golang.org/x/arch/arm64: update from upstream
Updates x/arch/arm64 to git rev. 530ae47 for CL 82437.

Change-Id: I0131f7ac783462fcaeddf5625c59784fe30bbd5a
Reviewed-on: https://go-review.googlesource.com/82435
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07 05:09:39 +00:00
Russ Cox
8156e76e44 cmd/go: implement time-based trimming of build cache
Fixes #22642.

Change-Id: I2ed6305555a0cf753b9cdce061463b1749d5e53e
Reviewed-on: https://go-review.googlesource.com/81975
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-06 18:46:11 +00:00
Russ Cox
49fec9b488 cmd/dist: disable test caching during run.bash
Sometimes people use run.bash repeatedly
or run go tool dist test by hand for cgo tests.
Avoid test caching in that case, by request.

Refactor code so that all go test commands
share a common prefix.

If not caching is problematic it will be a one-line
change to turn caching back on.

Fixes #22758.

Change-Id: I17d721b832d97bffe26629d21f85b05dbbf2b3ec
Reviewed-on: https://go-review.googlesource.com/80735
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-05 18:42:38 +00:00
Keith Randall
dd7cbf3a84 cmd/compile: fix map assignment with panicking right-hand side
Make sure that when we're assigning to a map, we evaluate the
right-hand side before we attempt to insert into the map.

We used to evaluate the left-hand side to a pointer-to-slot-in-bucket
(which as a side effect does len(m)++), then evaluate the right-hand side,
then do the assignment. That clearly isn't correct when the right-hand side
might panic.

Fixes #22881

Change-Id: I42a62870ff4bf480568c9bdbf0bb18958962bdf0
Reviewed-on: https://go-review.googlesource.com/81817
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-12-05 00:10:10 +00:00
Keith Randall
9d70b3ae04 cmd/compile: fix noopt builder, weird append case
Turn off append-to-itself optimization if optimizations are turned off.

This optimization triggered a bug when doing
  s = append(s, s)
where we write to the leftmost s before reading the rightmost s.

Update #17039

Change-Id: I21996532d20a75db6ec8d49db50cb157a1360b80
Reviewed-on: https://go-review.googlesource.com/81816
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-04 21:45:40 +00:00
Matthew Dempsky
509ffb94ca cmd/go: disable concurrent compilation under GOEXPERIMENTs
Duplicate cmd/compile check into cmd/go. Manually tested that
"GOEXPERIMENT=fieldtrack make.bash" passes now.

Updates #22223.

Change-Id: I441970a8a5ad4aadf5bd4fbd4d6cc71847b43308
Reviewed-on: https://go-review.googlesource.com/81776
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-04 19:37:24 +00:00
Than McIntosh
88c2fb9d04 cmd/compile: fix bug in DWARF inl handling of unused autos
The DWARF inline info generation hooks weren't properly
handling unused auto vars in certain cases, triggering an assert (now
fixed). Also with this change, introduce a new autom "flavor" to
use for autom entries that are added to insure that a specific
auto type makes it into the linker (this is a follow-on to the fix
for 22941).

Fixes #22962.

Change-Id: I7a2d8caf47f6ca897b12acb6a6de0eb25f5cac8f
Reviewed-on: https://go-review.googlesource.com/81557
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-12-04 18:36:11 +00:00
Russ Cox
1b9f66330b cmd/go: disable tests when GOOS/GOARCH != GOHOSTARCH/GOHOSTARCH
The whole GOROOT/pkg tree is installed using the GOHOSTOS/GOHOSTARCH
toolchain (installed in GOROOT/pkg/tool/GOHOSTOS_GOHOSTARCH).
The testgo.exe we run during the cmd/go test will be built
for GOOS/GOARCH, which means it will use the GOOS/GOARCH toolchain
(installed in GOROOT/pkg/tool/GOOS_GOARCH).

If these are not the same toolchain, then the entire standard library
will look out of date to testgo.exe (the compilers in those two different
tool directories are built for different architectures and have different
buid IDs), which will cause many tests to do unnecessary rebuilds
and some tests to attempt to overwrite the installed standard library,
which will in turn make it look out of date to whatever runs after the
cmd/go test exits.

Bail out entirely in this case instead of destroying the world.

The changes outside TestMain are checks that might have caught
this a bit earlier and made it much less confusing to debug.

Fixes #22709.
Fixes #22965.

Change-Id: Ibf28fa19e29a1f1b8f17875f446d3474dd04a924
Reviewed-on: https://go-review.googlesource.com/81516
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-04 05:15:50 +00:00
Russ Cox
f047422a18 cmd/go: fix -covermode=atomic use of sync/atomic in -coverpkg matches
If we're using -covermode=atomic with -coverpkg, to add coverage
to more than just the package being tested, then we need to make sure
to make sync/atomic available to the compiler for every package
being recompiled for coverage.

Fixes #22728.

Change-Id: I27f88f6a62e37d4a7455554cd03c8ca2b21f81a4
Reviewed-on: https://go-review.googlesource.com/81497
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-04 05:14:54 +00:00
Ian Lance Taylor
bfa7a558bf cmd/cgo: for C bitfields use only valid Go integer types
Fixes #22958

Change-Id: Ib078a5f6e1105a2afca77c6d9a05f65ddf5d9010
Reviewed-on: https://go-review.googlesource.com/81435
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2017-12-01 23:50:23 +00:00
Russ Cox
496688b3cf cmd/go: honor -timeout=0 to mean no timeout
The test binaries accept -timeout=0 to mean no timeout,
but then the backup timer in cmd/go kills the test after 1 minute.
Make cmd/go understand this special case and change
behavior accordingly.

Fixes #14780.

Change-Id: I66bf517173a4ad21d53a5ee88d163f04b8929fb6
Reviewed-on: https://go-review.googlesource.com/81499
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-01 21:09:19 +00:00
Russ Cox
7684fe0bf1 cmd/test2json: add ability to run test binary
Also be clear that go test output is not suitable for piping into test2json.

Fixes #22710.
Fixes #22789.

Change-Id: I3d850c8a2288be7f9a27d638bbf847cb8707dcce
Reviewed-on: https://go-review.googlesource.com/81555
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 21:06:36 +00:00
Russ Cox
7ef9f7250e cmd/go: fix missing conversions in -json output
1. Apply JSON conversion when -bench is in use.
2. Apply JSON conversion to "no test files" result.
3. Apply JSON conversion to test case-ending SKIP status.

Fixes #22769.
Fixes #22790.

Change-Id: I67ad656fc58bacae8c51d23b1e6d543cad190f08
Reviewed-on: https://go-review.googlesource.com/81535
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 21:06:23 +00:00
Russ Cox
232b2e3352 cmd/go: fix reuse of cached objects during cover
The cover variable indices could vary from build to build,
but they were not included in the build ID hash, so that
reusing the previously built package was not safe.
Make the indices no longer vary from build to build,
so that caching is safe.

Fixes #22652.

Change-Id: Ie26d73c648aadd285f97e0bf39619cabc3da54f2
Reviewed-on: https://go-review.googlesource.com/81515
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 21:06:14 +00:00
Russ Cox
76dc4b1952 cmd/go: ignore vet typecheck failure during go test
For Go 1.10, works around a go/types bug that can't typecheck
a corner-case type cycle. Once we are confident that bugs like
this are gone from go/types then we can stop ignoring these
failures.

For #22890.

Change-Id: I38da57e01a0636323e1af4484c30871786125df3
Reviewed-on: https://go-review.googlesource.com/81500
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 21:06:03 +00:00
Russ Cox
2f8bcc8940 cmd/go: accept more spaces in -gcflags arguments
Earlier versions of Go were not very picky about leading spaces
in the -gcflags values. Make the new pattern-enhanced parser
equally lax.

Fixes #22943.

Change-Id: I5cf4d3e81412e895a4b52af325853ed48d0b73f4
Reviewed-on: https://go-review.googlesource.com/81498
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 21:05:46 +00:00
Hana Kim
662938850b cmd/trace: exclude threads in syscall on behalf of runtime
The number of threads in syscall presented by execution tracer's
trace view includes not only the threads calling system calls on behalf
of user created goroutines, but also those running on behalf of system
goroutines.

When the number of such system goroutines was small, the graph was
useful when examining where a program was saturating the CPU.
But as more and more system goroutines are invloved the graph became
less useful for the purpose - for example, after golang.org/cl/34784,
the timer goroutines dominate in the graph with large P
because the runtime creates per-P timer goroutines.

This change excludes the threads in syscall on behalf of runtime (system
goroutines) from the visualization. Alternatively, I could visualize the
count of such threads in a separate counter but in the same graph.
Given that many other debug endpoints (e.g. /debug/pprof/goroutine) hide
the system goroutines, including them in the same graph can confuse users.

Update #22574

Change-Id: If758cd6b9ed0596fde9a471e846b93246580b9d5
Reviewed-on: https://go-review.googlesource.com/81315
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-01 21:00:50 +00:00
Robert Griesemer
088a9ad543 cmd/compile: permit indices of certain non-constant shifts
Per the decision for #14844, index expressions that are non-constant
shifts where the LHS operand is representable as an int are now valid.

Fixes #21693.

Change-Id: Ifafad2c0c65975e0200ce7e28d1db210e0eacd9d
Reviewed-on: https://go-review.googlesource.com/81277
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-12-01 20:39:50 +00:00
Russ Cox
1c55f579be cmd/go: apply same per-package flags to test and xtest builds
If package strings has a particular set of gcflags, then the strings_test
pseudo-package built as part of the test binary should inherit the same flags.

Fixes #22831.

Change-Id: I0e896b6c0f1063454300b7323f577feffbd6650b
Reviewed-on: https://go-review.googlesource.com/81496
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 19:47:39 +00:00
Russ Cox
4fb0af5d53 cmd/go: fix -x output for test build failure
If the build of the test binary failed, the go command correctly
avoided running the binary, but the -x output indicated otherwise.

Fixes #22659.

Change-Id: Ib4d262bf1735f057c994a45fc23c499d4ebe3246
Reviewed-on: https://go-review.googlesource.com/81495
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 19:47:30 +00:00
Russ Cox
3716ba0337 cmd/go: fix -outputdir -coverprofile interaction
The CL introducing merged handling of cover profiles
did not correctly account for the fact that the file name argument
to -coverprofile is required to be interpreted relative to
the -outputdir argument.

Fixes #22804.

Change-Id: I804774013c12187313b8fd2044302978bdbb6697
Reviewed-on: https://go-review.googlesource.com/81455
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 19:47:23 +00:00
Than McIntosh
9372166faa cmd/compile: fix DWARF type symbol buglet
The code that generates the list of DWARF variables for a function
(params and autos) will emit a "no-location" entry in the DWARF for a
user var that appears in the original pre-optimization version of the
function but is no longer around when optimization is complete. The
intent is that if a GDB user types "print foo" (where foo has been
optimized out), the response will be "<optimized out>" as opposed to
"there is no such variable 'foo'). This change fixes said code to
include vars on the autom list for the function, to insure that the
type symbol for the variable makes it to the linker.

Fixes #22941.

Change-Id: Id29f1f39d68fbb798602dfd6728603040624fc41
Reviewed-on: https://go-review.googlesource.com/81415
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-12-01 18:52:50 +00:00
Russ Cox
0c0c3c186b sync/atomic: remove noCopy from Value
Values must not be copied after the first use.

Using noCopy makes vet complain about copies
even before the first use, which is incorrect
and very frustrating.

Drop it.

Fixes #21504.

Change-Id: Icd3a5ac3fe11e84525b998e848ed18a5d996f45a
Reviewed-on: https://go-review.googlesource.com/80836
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-12-01 16:38:53 +00:00
David Chase
f22cf7131a cmd/compile: use src.NoXPos for entry-block constants
The ssa backend is aggressive about placing constants and
certain other values in the Entry block.  It's implausible
that the original line numbers for these constants makes
any sort of sense when it appears to a user stepping in a
debugger, and they're also not that useful in dumps since
entry-block instructions tend to be constants (i.e.,
unlikely to be the cause of a crash).

Therefore, use src.NoXPos for any values that are explicitly
inserted into a function's entry block.

Passes all tests, including ssa/debug_test.go with both
gdb and a fairly recent dlv.  Hand-verified that it solves
the reported problem; constructed a test that reproduced
a problem, and fixed it.

Modified test harness to allow injection of slightly more
interesting inputs.

Fixes #22558.

Change-Id: I4476927067846bc4366da7793d2375c111694c55
Reviewed-on: https://go-review.googlesource.com/81215
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-12-01 07:09:54 +00:00
Joe Tsai
b53088a634 Revert "go/printer: forbid empty line before first comment in block"
This reverts commit 08f19bbde1.

Reason for revert:
The changed transformation takes effect on a larger set
of code snippets than expected.

For example, this:
    func foo() {

        // Comment
        bar()

    }
becomes:
    func foo() {
        // Comment
        bar()

    }

This is an unintended consequence.

Change-Id: Ifca88d6267dab8a8170791f7205124712bf8ace8
Reviewed-on: https://go-review.googlesource.com/81335
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Joe Tsai <joetsai@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-01 01:12:26 +00:00
Matthew Dempsky
bd983a6d2e cmd/compile: fix GOEXPERIMENT checks
GOEXPERIMENT is only set during make.bash, so checking the environment
variable isn't effectual. Instead, check the values exposed by objabi.

These experiments look potentially safe, but it seems too late in the
release cycle to try to assuage that. The one exception is frame
pointer experiment, which is trivially safe: it just amounts to
incrementing some stack offsets by PtrSize.

Fixes #22223.

Change-Id: I46dc7c54b1347143d02d6b9635038230cda6d164
Reviewed-on: https://go-review.googlesource.com/80760
Reviewed-by: Russ Cox <rsc@golang.org>
2017-12-01 00:40:45 +00:00
Hana (Hyang-Ah) Kim
5bd66e5e1e cmd/trace: compute pprof-style output per goroutine type
The trace command computes IO, Schedule, Block, and Syscall profiles
by following the unblocking links in the execution trace and summing
up the duration.  This change offers variations of those profiles
that include only selected goroutine types. The id parameter takes the
goroutine type - i.e. pc of the goroutine.

The output is available from the /goroutine view. So, users can see
where the goroutines of interest typically block.

Also, these profiles are available for download so users can use
pprof or other tools to interpret the output. This change adds links
for download of global profile in the main page.

Change-Id: I35699252056d164e60de282b0406caf96d629c85
Reviewed-on: https://go-review.googlesource.com/75710
Reviewed-by: Sameer Ajmani <sameer@golang.org>
2017-11-30 19:34:32 +00:00
Vladimir Stefanovic
6be1c09e19 cmd/compile: use soft-float routines for soft-float targets
Updates #18162 (mostly fixes)

Change-Id: I35bcb8a688bdaa432adb0ddbb73a2f7adda47b9e
Reviewed-on: https://go-review.googlesource.com/37958
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2017-11-30 17:37:37 +00:00
Vladimir Stefanovic
12abacb555 cmd/go, cmd/dist: introduce GOMIPS environment variable
GOMIPS is a GOARCH=mips{,le} specific option, for a choice between
hard-float and soft-float. Valid values are 'hardfloat' (default) and
'softfloat'. It is passed to the assembler as
'GOMIPS_{hardfloat,softfloat}'.

Note: GOMIPS will later also be used for a choice of MIPS instruction
set (mips32/mips32r2).

Updates #18162

Change-Id: I35417db8625695f09d6ccc3042431dd2eaa756a6
Reviewed-on: https://go-review.googlesource.com/37954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-30 16:57:08 +00:00
Tobias Klauser
4f5018594d cmd/go: fix typo in link action ID hash input string
Fix a typo of "packageshlib" used for generating the link action ID.

Change-Id: Id6d39830908b03de658a58661030c32c592a1da9
Reviewed-on: https://go-review.googlesource.com/80935
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2017-11-30 16:19:05 +00:00
Than McIntosh
4435fcfd6c compiler,linker: support for DWARF inlined instances
Compiler and linker changes to support DWARF inlined instances,
see https://go.googlesource.com/proposal/+/HEAD/design/22080-dwarf-inlining.md
for design details.

This functionality is gated via the cmd/compile option -gendwarfinl=N,
where N={0,1,2}, where a value of 0 disables dwarf inline generation,
a value of 1 turns on dwarf generation without tracking of formal/local
vars from inlined routines, and a value of 2 enables inlines with
variable tracking.

Updates #22080

Change-Id: I69309b3b815d9fed04aebddc0b8d33d0dbbfad6e
Reviewed-on: https://go-review.googlesource.com/75550
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-11-30 14:39:19 +00:00
Cherry Zhang
dbb1d198ab cmd/compile: fix loop depth of range expression in escape analysis
ORANGE node's Right node is the expression it is ranging over,
which is evaluated before the loop. In the escape analysis,
we should walk this node without loop depth incremented.

Fixes #21709.

Change-Id: Idc1e4c76e39afb5a344d85f6b497930a488ce5cf
Reviewed-on: https://go-review.googlesource.com/80740
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2017-11-30 13:45:18 +00:00
Cherry Zhang
905b1c9804 cmd/vendor/golang.org/x/arch: revendor at commit dda8112
Updates #20650 (CL 45099 introduced the feature to x86).

Change-Id: If40cc9d87417a05281d8633f05cd91f6f434b136
Reviewed-on: https://go-review.googlesource.com/80843
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 22:23:32 +00:00
Cherry Zhang
a7dcfa6133 cmd/internal/objfile: make lookupFunc an alias type
In the x/arch repo, CL 45098 introduced SymLookup type, replacing
the unnamed function type for lookup functions. This affects the
signature of x86asm.GoSyntax. In particular, it cannot convert
one named type, namely lookupFunc, to the other without an
explicit cast. Make lookupFunc unnamed to fix.

Change-Id: I973300d29ef1dbfdbd7fc2429e89c5849e6a7329
Reviewed-on: https://go-review.googlesource.com/80842
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-11-29 22:22:38 +00:00
Matthew Dempsky
2f588ff08f cmd/compile: make -asmhdr work with type aliases
For "type T = U" we were accidentally emitting a #define for "U__size"
instead of "T__size".

Fixes #22877.

Change-Id: I5ed6757d697753ed6d944077c16150759f6e1285
Reviewed-on: https://go-review.googlesource.com/80759
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-29 20:40:41 +00:00
Jess Frazelle
0c14345c96 cmd/go: ensure pkgsFilter is run before build
Return an error when a user passes -o and -buildmode=exe to build a package
without a main.

Fixes #20017.

Change-Id: I07d49c75e7088a96f00afe18c9faa842c5d71afb
Reviewed-on: https://go-review.googlesource.com/49371
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-29 16:54:25 +00:00
Inanc Gumus
153e4096a8 testing: add -failfast to go test
When -test.failfast flag is provided to go test,
no new tests get started after the first failure.

Fixes #21700

Change-Id: I0092e72f25847af05e7c8e1b811dcbb65a00cbe7
Reviewed-on: https://go-review.googlesource.com/74450
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-29 16:20:49 +00:00
Jess Frazelle
4a483ce2ab cmd/cgo: fix for function taking pointer typedef
Fixes #19832

Change-Id: I7ce39c2c435d4716d8a42ac6784b4c87874c0e13
Reviewed-on: https://go-review.googlesource.com/49490
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-11-29 16:12:45 +00:00