1
0
mirror of https://github.com/golang/go synced 2024-11-17 07:35:05 -07:00
Commit Graph

48548 Commits

Author SHA1 Message Date
Matthew Dempsky
859d903b06 [dev.typeparams] cmd/compile: add -d=unifiedquirks for quirks mode
Originally, overloading -d=inlfuncswithclosures=0 to enable quirks
mode was convenient because toolstash -cmp doesn't provide a way to
pass different gcflags to the installed vs stashed toolchains. Prior
to unified IR being merged, the stashed toolchain wouldn't know about
or accept any unified-specific flags.

However, this concern is no longer applicable since unified IR has
been merged, and the TestUnifiedCompare test can easily specify
different flag sets for the baseline and experiment build configs.

This CL adds a new -d=unifiedquirks flag to enable quirks mode, so
that it's possible to test unified IR with -d=inlfuncswithclosures=0
without also affecting a bunch of other compilation details.

Change-Id: Id1932f332822622aa8617278e82ec6d1a53b1b46
Reviewed-on: https://go-review.googlesource.com/c/go/+/329733
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-22 04:24:29 +00:00
Cuong Manh Le
d626ba27bb [dev.typeparams] all: merge master (16e82be) into dev.typeparams
Merge List:

+ 2021-06-21 16e82be454 runtime: fix crash during VDSO calls on PowerPC
+ 2021-06-21 2e542c3c06 runtime/pprof: deflake TestMorestack more
+ 2021-06-21 ced0fdbad0 doc/go1.17: note deprecation of 'go get' for installing commands
+ 2021-06-21 7a5e7047a4 doc/go1.17: add Go 1.18 pre-announcements
+ 2021-06-21 85a2e24afd doc/go1.17: add security-related release notes
+ 2021-06-21 1de332996c doc/go1.17: document go/parser.SkipObjectResolution
+ 2021-06-21 117ebe0f52 cmd/go: do not require the module cache to exist for 'go mod edit'
+ 2021-06-20 460900a7b5 os/signal: test with a significantly longer fatal timeout
+ 2021-06-19 b73cc4b02b database/sql: do not rely on timeout for deadlock test
+ 2021-06-18 86743e7d86 image: add RGBA64Image interface
+ 2021-06-18 9401172166 runtime: clarify Frames.Next documentation
+ 2021-06-18 57aaa19aae runtime: disable CPU profiling before removing the SIGPROF handler
+ 2021-06-18 6f22d2c682 doc/go1.17: fix typo
+ 2021-06-17 45f251ad6c cmd/pprof,runtime/pprof: disable test on more broken platforms
+ 2021-06-17 ed834853ad cmd/go: replace a TODO with an explanatory comment
+ 2021-06-17 4dede02550 cmd/pprof: make ObjAddr a no-op
+ 2021-06-17 97cee43c93 testing: drop unusual characters from TempDir directory name
+ 2021-06-17 b0355a3e72 time: fix receiver for Time.IsDST method
+ 2021-06-17 881b6ea7ba doc/go1.17: fix redundant space
+ 2021-06-16 0e67ce3d28 cmd/go: in lazy modules, add transitive imports for 'go get' arguments
+ 2021-06-16 6ea2af0890 cmd/go: add a regression test for #45979
+ 2021-06-16 a294e4e798 math/rand: mention half-open intervals explicitly
+ 2021-06-16 a6a853f94c cmd/asm: restore supporting of *1 scaling on ARM64

Change-Id: Ifdcb817fd44b4fa9c477042b41da55d1d769b016
2021-06-22 00:35:08 +07:00
Derek Parker
16e82be454 runtime: fix crash during VDSO calls on PowerPC
This patch reinstates a fix for PowerPC with regard to making VDSO calls
while receiving a signal, and subsequently crashing. The crash happens
because certain VDSO calls can modify the r30 register, which is where g
is stored. This change was reverted for PowerPC because r30 is supposed
to be a non-volatile register. This is true, but that only makes a
guarantee across function calls, but not "within" a function call. This
patch was seemingly fine before because the Linux kernel still had hand
rolled assembly VDSO function calls, however with a recent change to C
function calls it seems the compiler used can generate instructions
which temporarily clobber r30. This means that when we receive a signal
during one of these calls the value of r30 will not be the g as the
runtime expects, causing a segfault.

You can see from this assembly dump how the register is clobbered during
the call:

(the following is from a 5.13rc2 kernel)

```
Dump of assembler code for function __cvdso_clock_gettime_data:
   0x00007ffff7ff0700 <+0>:     cmplwi  r4,15
   0x00007ffff7ff0704 <+4>:     bgt     0x7ffff7ff07f0 <__cvdso_clock_gettime_data+240>
   0x00007ffff7ff0708 <+8>:     li      r9,1
   0x00007ffff7ff070c <+12>:    slw     r9,r9,r4
   0x00007ffff7ff0710 <+16>:    andi.   r10,r9,2179
   0x00007ffff7ff0714 <+20>:    beq     0x7ffff7ff0810 <__cvdso_clock_gettime_data+272>
   0x00007ffff7ff0718 <+24>:    rldicr  r10,r4,4,59
   0x00007ffff7ff071c <+28>:    lis     r9,32767
   0x00007ffff7ff0720 <+32>:    std     r30,-16(r1)
   0x00007ffff7ff0724 <+36>:    std     r31,-8(r1)
   0x00007ffff7ff0728 <+40>:    add     r6,r3,r10
   0x00007ffff7ff072c <+44>:    ori     r4,r9,65535
   0x00007ffff7ff0730 <+48>:    lwz     r8,0(r3)
   0x00007ffff7ff0734 <+52>:    andi.   r9,r8,1
   0x00007ffff7ff0738 <+56>:    bne     0x7ffff7ff07d0 <__cvdso_clock_gettime_data+208>
   0x00007ffff7ff073c <+60>:    lwsync
   0x00007ffff7ff0740 <+64>:    mftb    r30      <---- RIGHT HERE
=> 0x00007ffff7ff0744 <+68>:    ld      r12,40(r6)
```

What I believe is happening is that the kernel changed the PowerPC VDSO
calls to use standard C calls instead of using hand rolled assembly. The
hand rolled assembly calls never touched r30, so this change was safe to
roll back. That does not seem to be the case anymore as on the 5.13rc2
kernel the compiler *is* generating assembly which modifies r30, making
this change again unsafe and causing a crash when the program receives a
signal during these calls (which will happen often due to async
preempt). This change happened here:
https://lwn.net/ml/linux-kernel/235e5571959cfa89ced081d7e838ed5ff38447d2.1601365870.git.christophe.leroy@csgroup.eu/.

I realize this was reverted due to unexplained hangs in PowerPC
builders, but I think we should reinstate this change and investigate
those issues separately:
f4ca3c1e0a

Fixes #46803

Change-Id: Ib18d7bbfc80a1a9cb558f0098878d41081324b52
GitHub-Last-Rev: c3002bcfca
GitHub-Pull-Request: golang/go#46767
Reviewed-on: https://go-review.googlesource.com/c/go/+/328110
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
2021-06-21 16:58:36 +00:00
Cherry Mui
2e542c3c06 runtime/pprof: deflake TestMorestack more
Apparently, TestMorestack is still flaky on darwin/arm64 builder
after CL 307730. Let it spend more time in copying the stack.
With this CL, on my Apple M1 machine it passes reliably in short
mode for 1000 runs, and reliably gets 250+ samples in the 5-second
interval in long mode.

May fix #46755.

Change-Id: I07b36c1cf63ad35f7820e1f8e837e29376a37b2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/329869
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2021-06-21 16:48:36 +00:00
Jay Conrod
ced0fdbad0 doc/go1.17: note deprecation of 'go get' for installing commands
Fixes #43684

Change-Id: I8982f6816c002c71e62f37a926c8543e34b8b785
Reviewed-on: https://go-review.googlesource.com/c/go/+/329549
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-06-21 15:39:45 +00:00
Filippo Valsorda
7a5e7047a4 doc/go1.17: add Go 1.18 pre-announcements
Updates #41682
Updates #45428

Change-Id: Ia31d454284f0e114bd29ba398a2858fc90454032
Reviewed-on: https://go-review.googlesource.com/c/go/+/327811
Trust: Filippo Valsorda <filippo@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
2021-06-21 14:58:02 +00:00
Filippo Valsorda
85a2e24afd doc/go1.17: add security-related release notes
Change-Id: I573def0f48fe66a1bc60fff321ab007c76b47ef0
Reviewed-on: https://go-review.googlesource.com/c/go/+/327810
Reviewed-by: Katie Hockman <katie@golang.org>
Trust: Katie Hockman <katie@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
2021-06-21 14:57:47 +00:00
Rob Findley
1de332996c doc/go1.17: document go/parser.SkipObjectResolution
Documents the mode added in CL 306149 to skip object resolution.

Fixes #46298

Change-Id: I6a14aaa00790f9f7e4e4ba17033355f5e878d74b
Reviewed-on: https://go-review.googlesource.com/c/go/+/329009
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-06-21 14:12:09 +00:00
Bryan C. Mills
117ebe0f52 cmd/go: do not require the module cache to exist for 'go mod edit'
Updates #46695

Change-Id: I4afbc1401ef4183d94c1ac6271394fac1fff95ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/328769
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
2021-06-21 14:10:22 +00:00
Cuong Manh Le
844c076359 [dev.typeparams] cmd/compile: simplify import* functions
CL 280634 remove Sym.Importdef, so ipkg in importsym is not used
anymore. So we can remove it from importsym and all other import*
functions, which just call importsym internally.

Change-Id: I15b9d11c4445dbe40982f7ff2a33a2116705e790
Reviewed-on: https://go-review.googlesource.com/c/go/+/329573
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-21 04:53:37 +00:00
Cuong Manh Le
e57da8e53c [dev.typeparams] cmd/compile: explain why reader.funcExt need to set n.Defn
Change-Id: I1a7d669879af57a1c1f48ce63ff0d214b694e680
Reviewed-on: https://go-review.googlesource.com/c/go/+/329572
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-21 04:53:21 +00:00
Cuong Manh Le
3f7f72a258 [dev.typeparams] cmd/compile: fold reader checking type params logic to separate method
So making it less verbose and clearer to the reader what that check means.

Change-Id: I41587aab399e63600356c5cecec64978048bed36
Reviewed-on: https://go-review.googlesource.com/c/go/+/329571
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-21 04:53:09 +00:00
Andrew G. Morgan
460900a7b5 os/signal: test with a significantly longer fatal timeout
We've observed some occasional os-arch specific timeouts
in signal.TestSignalTrace(). While the main purpose of a
short timeout is to ensure the passing tests complete
quickly, the unexpected failure path can tolerate waiting
longer (the test is not intended to test how slow or
overloaded the OS is at the time it is run).

Fixes #46736
Change-Id: Ib392fc6ce485a919612784ca88ed76c30f4898e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/329502
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
2021-06-20 11:17:27 +00:00
Cuong Manh Le
d24c90a153 [dev.typeparams] cmd/compile: explain how pkgReader.typIdx handles alias cyclic
Change-Id: Ib9357c21bb010abf0d5fd17c3bee3197854c3a8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/329570
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-20 06:27:46 +00:00
Daniel Theophanes
b73cc4b02b database/sql: do not rely on timeout for deadlock test
Fixes #46783

Change-Id: I8a8d1716279a041a7411c0c47a440a7997b39c80
Reviewed-on: https://go-review.googlesource.com/c/go/+/328649
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Carlos Amedee <carlos@golang.org>
2021-06-19 00:46:21 +00:00
Nigel Tao
86743e7d86 image: add RGBA64Image interface
The new RGBA64At method is equivalent to the existing At method (and the
new SetRGBA64 method is equivalent to the existing Set method in the
image/draw package), but they can avoid allocations from converting
concrete color types to the color.Color interface type.

Also update api/go1.17.txt and doc/go1.17.html

Fixes #44808

Change-Id: I8671f3144512b1200fa373840ed6729a5d61bc35
Reviewed-on: https://go-review.googlesource.com/c/go/+/311129
Trust: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2021-06-18 23:57:09 +00:00
Matthew Dempsky
3f7a3133da [dev.typeparams] cmd/compile: add "toolstash -cmp"-like test of -d=unified
This CL adds a longtest test to make sure -d=unified=1 produces output
identical to -d=unified=0.

Change-Id: I2c5d38f67dbc8fecd8332a91ba7cae22225b090c
Reviewed-on: https://go-review.googlesource.com/c/go/+/329429
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2021-06-18 23:20:30 +00:00
Matthew Dempsky
9401172166 runtime: clarify Frames.Next documentation
I wrote code that relied on this API, but I misunderstood the original
description of the "more" result. As a consequence, my code always
stopped one frame early.

This CL expands the documentation to be more explicit and specifically
call out my confusion (i.e., that the "more" result indicates whether
the *next* Next call will return a valid Frame, and not whether this
call did).

Change-Id: If135f8f8c05425073d45377c4179e4f79e6bd6ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/329389
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
2021-06-18 22:05:09 +00:00
Ian Lance Taylor
57aaa19aae runtime: disable CPU profiling before removing the SIGPROF handler
Otherwise, in c-archive or c-shared mode, there is the chance of
getting a SIGPROF just after the signal handler is removed but before
profiling is disabled, in which case the program will die.

Fixes #46498

Change-Id: I5492beef45fec9fb9a7f58724356d6aedaf799ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/329290
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-06-18 16:56:48 +00:00
Dan Scales
e9c01f9804 [dev.typeparams] cmd/compile: add missing copy of Field.Embedded in type substituter.
Change-Id: I876933370a6bcb6586eda9d8fc28a081bf31b1cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/328511
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
2021-06-18 16:33:06 +00:00
Nick Miyake
6f22d2c682 doc/go1.17: fix typo
Change-Id: Ie8629e0f710d3eb95b4bbcc9c680ffc5004c2f15
GitHub-Last-Rev: 52f48f429c
GitHub-Pull-Request: golang/go#46812
Reviewed-on: https://go-review.googlesource.com/c/go/+/329289
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2021-06-18 11:01:12 +00:00
Cuong Manh Le
6fa0437958 [dev.typeparams] cmd/compile: add documentation for unified IR pipeline
While at it, also rename "useUnifiedIR" to "unified", to be consistent
with "-d=unified" and "GOEXPERIMENT=unified".

Change-Id: I48ffdb4b36368343893b74f174608f5f59278249
Reviewed-on: https://go-review.googlesource.com/c/go/+/328989
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-18 09:24:03 +00:00
Matthew Dempsky
54fe57bc22 [dev.typeparams] cmd/compile: record writer's stack at export data sync points
This CL extends the unified export data format's existing sync
mechanism to save writer stacks, controlled by the -d=syncframes debug
flag. This allows readers to provide more details when reporting
desync errors, which should simplify development of the data format
and the various reader/writer implementations.

For example, CL 328051 updated reader and writer, but missed making a
similar change to the linker (fix in CL 328054). Re-reviewing the CL
in isolation after the failure, it was not immediately obvious what
was going wrong. But the pair of stack traces below identifies exactly
what happened: it should have updated linker.relocFuncExt to write out
the new sync marker too.

```
data sync error: package "internal/abi", section 6, index 4, offset 536

found UseReloc, written at:
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/encoder.go:221: (*encoder).reloc +0x44
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/linker.go:214: (*linker).relocFuncExt +0x580
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/linker.go:233: (*linker).relocTypeExt +0x234
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/linker.go:161: (*linker).relocObj +0x2198
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/linker.go:64: (*linker).relocIdx +0x196

expected ImplicitTypes, reading at:
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/reader.go:796: (*reader).implicitTypes +0x36
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/reader.go:810: (*reader).addBody +0x81
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/reader.go:727: (*reader).funcExt +0x542
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/reader.go:651: (*reader).method +0x324
	/home/mdempsky/wd/go/src/cmd/compile/internal/noder/reader.go:557: (*pkgReader).objIdx +0x2704
```

Change-Id: I911193edd2a965f81b7459f15fb613a773584685
Reviewed-on: https://go-review.googlesource.com/c/go/+/328909
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-06-18 06:33:12 +00:00
Michael Anthony Knyszek
78aa251ace [dev.typeparams] cmd/go: include new internal packages in TestNewReleaseRebuildsStalePackagesInGOPATH
CL 328336 introduced two new packages that the runtime and other
low-level packages depend on. Include them as targets to copy in this
test with other such packages.

Fixes the dev.typeparams longtest builders.

Change-Id: Ia886f0264962a68acd06ebca002eef8515f06487
Reviewed-on: https://go-review.googlesource.com/c/go/+/329251
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-18 04:55:13 +00:00
Cuong Manh Le
2a7900762c [dev.typeparams] go/types: report better error for invalid untyped operation
This is port of CL 328053 for types2 to go/type.

The change is identical, but for some tweaks to the error positions in
tests.

Updates #46749

Change-Id: I8d34c5b1669e59e4ec7d91f81dcf655b2bfd89a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/328869
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-06-18 02:07:04 +00:00
Robert Griesemer
90096f445e [dev.typeparams] cmd/compile/internal/syntax: convert (most) parser tests to new type set syntax
Left a couple of tests with old notation so that we keep testing it
while the notation is still supported.

Change-Id: Ia6a3e7911af87eaccc7b06189c10f79789575a98
Reviewed-on: https://go-review.googlesource.com/c/go/+/328256
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-06-18 01:06:13 +00:00
Matthew Dempsky
feec53c4e5 [dev.typeparams] cmd/compile: skip types2 GC test during bootstrapping
Unified includes a check to make sure that types2 memory has been
garbage collected, but it relies on precise finalization, which we
provide (for dynamically allocated objects, at least) but isn't
guaranteed by the Go spec. In particular, Go 1.4 doesn't provide this.

The check is strictly unnecessary and only exists to make sure we
don't regress and start holding onto types2 memory accidentally. So
just disable the check during bootstrap builds.

Change-Id: Ie54fe53b2edba02c0b0b1e5ae39d81be8a0ace8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/329269
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-06-17 23:14:04 +00:00
Michael Pratt
45f251ad6c cmd/pprof,runtime/pprof: disable test on more broken platforms
runtime/pprof has a more complete list of platforms with broken
profiling than I used in cmd/pprof in https://golang.org/cl/325809.
Duplicate that list in cmd/pprof and clean it up a bit in runtime/pprof
for easier reference.

Change-Id: I8f2580aac223de9b73cfff4355f49916f7b76493
Reviewed-on: https://go-review.googlesource.com/c/go/+/329149
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-17 21:58:54 +00:00
Michael Anthony Knyszek
fb84d213a8 [dev.typeparams] reflect: support big endian architectures in callMethod
Currently, callMethod has some ABI translation code that is not agnostic
of endianness. This change rectifies that by adding a method to
internal/abi.RegArgs for safely returning an offset into a register slot
that's endianness-dependent.

No tests for this because it's just best-effort. There's no actual way
to test this because we don't support a register ABI on any big endian
architectures yet.

Change-Id: Ic68d9ee1bfdea0fc2992d467d749e2b083e92de3
Reviewed-on: https://go-review.googlesource.com/c/go/+/328348
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-06-17 21:30:24 +00:00
Michael Anthony Knyszek
9f50d9a0b4 [dev.typeparams] internal/reflectlite: remove unused ptrSize
Change-Id: Ia0da5e5d1e8d20327690cb53c9df067401f3428c
Reviewed-on: https://go-review.googlesource.com/c/go/+/328812
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:29:40 +00:00
Michael Anthony Knyszek
890a8407a9 [dev.typeparams] internal/reflectlite: use goarch.PtrSize instead of the duplicated ptrSize [generated]
[git-generate]
cd src/internal/reflectlite
gofmt -w -r "ptrSize -> goarch.PtrSize" .
goimports -w *.go

Change-Id: I6a55f2aa035ed863785856ddd4fcc519dec15ac9
Reviewed-on: https://go-review.googlesource.com/c/go/+/328347
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:29:35 +00:00
Michael Anthony Knyszek
bfd9b63f12 [dev.typeparams] reflect: delete unused ptrSize and PtrSize
Change-Id: I522263eb5112b78639340b83d92e80a13f738bd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/328811
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:29:28 +00:00
Michael Anthony Knyszek
95c104ee61 [dev.typeparams] reflect: use goarch.PtrSize instead of the duplicated ptrSize [generated]
[git-generate]
cd src/reflect
gofmt -w -r "PtrSize -> goarch.PtrSize" .
gofmt -w -r "ptrSize -> goarch.PtrSize" .
goimports -w *.go

Change-Id: Ib534bb0ecde10d93f45365ab4f8efd620d6d2ef3
Reviewed-on: https://go-review.googlesource.com/c/go/+/328346
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:29:22 +00:00
Michael Anthony Knyszek
2e600fb8b3 [dev.typeparams] runtime/internal/sys: remove unused Goarch* and Goos* constants
Change-Id: Ibc8381662242c6754f34edce9c0ad81681f55940
Reviewed-on: https://go-review.googlesource.com/c/go/+/329192
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-17 21:29:15 +00:00
Michael Anthony Knyszek
46e1e74a86 [dev.typeparams] runtime: replace Goarch* constants with internal/goarch versions [generated]
[git-generate]
cd src/runtime
gofmt -w -r "sys.Goarch386         -> goarch.Is386" .
gofmt -w -r "sys.GoarchAmd64       -> goarch.IsAmd64" .
gofmt -w -r "sys.GoarchAmd64p32    -> goarch.IsAmd64p32" .
gofmt -w -r "sys.GoarchArm         -> goarch.IsArm" .
gofmt -w -r "sys.GoarchArmbe       -> goarch.IsArmbe" .
gofmt -w -r "sys.GoarchArm64       -> goarch.IsArm64" .
gofmt -w -r "sys.GoarchArm64be     -> goarch.IsArm64be" .
gofmt -w -r "sys.GoarchPpc64       -> goarch.IsPpc64" .
gofmt -w -r "sys.GoarchPpc64le     -> goarch.IsPpc64le" .
gofmt -w -r "sys.GoarchMips        -> goarch.IsMips" .
gofmt -w -r "sys.GoarchMipsle      -> goarch.IsMipsle" .
gofmt -w -r "sys.GoarchMips64      -> goarch.IsMips64" .
gofmt -w -r "sys.GoarchMips64le    -> goarch.IsMips64le" .
gofmt -w -r "sys.GoarchMips64p32   -> goarch.IsMips64p32" .
gofmt -w -r "sys.GoarchMips64p32le -> goarch.IsMips64p32le" .
gofmt -w -r "sys.GoarchPpc         -> goarch.IsPpc" .
gofmt -w -r "sys.GoarchRiscv       -> goarch.IsRiscv" .
gofmt -w -r "sys.GoarchRiscv64     -> goarch.IsRiscv64" .
gofmt -w -r "sys.GoarchS390        -> goarch.IsS390" .
gofmt -w -r "sys.GoarchS390x       -> goarch.IsS390x" .
gofmt -w -r "sys.GoarchSparc       -> goarch.IsSparc" .
gofmt -w -r "sys.GoarchSparc64     -> goarch.IsSparc64" .
gofmt -w -r "sys.GoarchWasm        -> goarch.IsWasm" .
goimports -w *.go

Change-Id: I9d88e1284efabaeb0ee3733cba6286247d078c85
Reviewed-on: https://go-review.googlesource.com/c/go/+/328345
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:29:09 +00:00
Michael Anthony Knyszek
7b0e9cae66 [dev.typeparams] runtime: replace Goos* constants with internal/goos versions [generated]
[git-generate]
cd src/runtime
gofmt -w -r "sys.GoosAix       -> goos.IsAix" .
gofmt -w -r "sys.GoosAndroid   -> goos.IsAndroid" .
gofmt -w -r "sys.GoosDarwin    -> goos.IsDarwin" .
gofmt -w -r "sys.GoosDragonfly -> goos.IsDragonfly" .
gofmt -w -r "sys.GoosFreebsd   -> goos.IsFreebsd" .
gofmt -w -r "sys.GoosHurd      -> goos.IsHurd" .
gofmt -w -r "sys.GoosIllumos   -> goos.IsIllumos" .
gofmt -w -r "sys.GoosIos       -> goos.IsIos" .
gofmt -w -r "sys.GoosJs        -> goos.IsJs" .
gofmt -w -r "sys.GoosLinux     -> goos.IsLinux" .
gofmt -w -r "sys.GoosNacl      -> goos.IsNacl" .
gofmt -w -r "sys.GoosNetbsd    -> goos.IsNetbsd" .
gofmt -w -r "sys.GoosOpenbsd   -> goos.IsOpenbsd" .
gofmt -w -r "sys.GoosPlan9     -> goos.IsPlan9" .
gofmt -w -r "sys.GoosSolaris   -> goos.IsSolaris" .
gofmt -w -r "sys.GoosWindows   -> goos.IsWindows" .
gofmt -w -r "sys.GoosZos       -> goos.IsZos" .
goimports -w *.go

Change-Id: I42bed2907317ed409812e5a3e2897c88a5d36f24
Reviewed-on: https://go-review.googlesource.com/c/go/+/328344
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:29:02 +00:00
Michael Anthony Knyszek
81a6a4354b [dev.typeparams] internal/goarch,internal/goos: rename Goos and Goarch constants
Lots of constants in these packages start with Goarch and Goos, which is
redundant. Instead, add the "Is" prefix to make the constant clearer,
and to differentiate from the arch family constants.

Change-Id: Id92c1d3e911296a72949f8c9d649f142e7dc9d17
Reviewed-on: https://go-review.googlesource.com/c/go/+/328343
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 21:28:55 +00:00
Michael Anthony Knyszek
33d1b82d16 [dev.typeparams] runtime/internal/sys: replace ArchFamily and constants with goarch
Refactoring with rf

    rf 'ex . {
      import "internal/goarch"
      import "runtime/internal/sys"
      sys.ArchFamily -> goarch.ArchFamily
      sys.AMD64 -> goarch.AMD64
      sys.ARM -> goarch.ARM
      sys.ARM64 -> goarch.ARM64
      sys.I386 -> goarch.I386
      sys.MIPS -> goarch.MIPS
      sys.MIPS64 -> goarch.MIPS64
      sys.PPC64 -> goarch.PPC64
      sys.RISCV64 -> goarch.RISCV64
      sys.S390X -> goarch.S390X
      sys.WASM -> goarch.WASM
    }'

Change-Id: I0cc29ed3fdcf9ff39aa901d8bc92270996f0821c
Reviewed-on: https://go-review.googlesource.com/c/go/+/328341
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 20:56:29 +00:00
Michael Anthony Knyszek
85b12a8563 [dev.typeparams] runtime,runtime/internal/sys: remove unused BigEndian
Change-Id: I1209904326b1563e12d9c7d19a12a10c72d1dbcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/329191
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-17 20:42:41 +00:00
Michael Anthony Knyszek
9a93072a07 [dev.typeparams] runtime/internal/sys: replace BigEndian with goarch.BigEndian [generated]
[git-generate]
cd src/runtime/internal/atomic
gofmt -w -r "sys.BigEndian -> goarch.BigEndian" .
goimports -w *.go
cd ../..
gofmt -w -r "sys.BigEndian -> goarch.BigEndian" .
goimports -w *.go

Change-Id: Iad35d2b367d8defb081a77ca837e7a7c805c2b7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/329190
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-17 20:42:35 +00:00
Michael Anthony Knyszek
9c58e399a4 [dev.typeparams] runtime: fix import sort order [generated]
[git-generate]
cd src/runtime
goimports -w *.go

Change-Id: I1387af0f2fd1a213dc2f4c122e83a8db0fcb15f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/329189
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-17 20:42:23 +00:00
Michael Anthony Knyszek
671954e72e [dev.typeparams] runtime/internal/sys: replace GOOS with goos.GOOS
Refactoring done by rf tool:

    rf 'ex . {
	import "internal/goos"
	import "runtime/internal/sys"
	sys.GOOS -> goos.GOOS
    }'

Change-Id: I4b4aadff8640731ce4cb9bdad9954c267eb484c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/328339
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 20:42:08 +00:00
Michael Anthony Knyszek
5c028751bd [dev.typeparams] runtime/internal/sys: replace uses of GOARCH with goarch.GOARCH
Refactoring performed by the rf tool:

    rf 'ex . {
	import "internal/goarch"
	import "runtime/internal/sys"
	sys.GOARCH -> goarch.GOARCH
    }'

Change-Id: I4b0246bf4e734f08313c6fff7b547db362057714
Reviewed-on: https://go-review.googlesource.com/c/go/+/328338
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 20:42:01 +00:00
Bryan C. Mills
ed834853ad cmd/go: replace a TODO with an explanatory comment
I left a TODO to decide whether to add 'go get' arguments as indirect
(as we have in the past), or to make them direct. I considered both
options, and decided to keep the indirect default because it is easier
(and less invasive) for users to fix.

Updates #45979

Change-Id: I1f23a88db59a01bdd9e6fe48c2fffc8a3b55145a
Reviewed-on: https://go-review.googlesource.com/c/go/+/328971
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
2021-06-17 19:52:18 +00:00
Michael Anthony Knyszek
6d89c90fb1 [dev.typeparams] runtime/internal/sys: remove unused PtrSize
Change-Id: I01e079b95f71b01edaf049d49a0993a7ed39c7bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/328810
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 18:54:59 +00:00
Michael Anthony Knyszek
6d85891b29 [dev.typeparams] runtime: replace uses of runtime/internal/sys.PtrSize with internal/goarch.PtrSize [generated]
[git-generate]
cd src/runtime/internal/math
gofmt -w -r "sys.PtrSize -> goarch.PtrSize" .
goimports -w *.go
cd ../..
gofmt -w -r "sys.PtrSize -> goarch.PtrSize" .
goimports -w *.go

Change-Id: I43491cdd54d2e06d4d04152b3d213851b7d6d423
Reviewed-on: https://go-review.googlesource.com/c/go/+/328337
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-06-17 18:54:48 +00:00
Michael Anthony Knyszek
122f5e16d6 [dev.typeparams] internal/goarch,internal/goos: explode runtime/internal/sys into pieces
This change extracts the GOOS and GOARCH specific constants from
runtime/internal/sys into packages that are available to the entire
standard library.

This change does not yet update the runtime and associated packages to
use them, and instead adds constants to runtime/internal/sys to forward
the constants defined by these new packages.

Change-Id: I14d574b8d7bfe599ad25da29dc1b39716e35a734
Reviewed-on: https://go-review.googlesource.com/c/go/+/328336
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-06-17 18:54:38 +00:00
Michael Pratt
4dede02550 cmd/pprof: make ObjAddr a no-op
https://golang.org/cl/318049 replaced driver.ObjFile.Base with
driver.ObjFile.ObjAddr. We don't support shared libraries, so these
should be no-op, but CL 318049 accidentally failed to account from the
change in no-op behavior from returning 0 to passing through addr.

Fixes #46636

Change-Id: Iab82224c7db722a1e257ec6e305218e22114d0a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/325809
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-06-17 14:53:37 +00:00
Matthew Dempsky
804ecc2581 [dev.typeparams] all: add GOEXPERIMENT=unified knob
Setting `-gcflags=all=-d=unified` works for normal builds/tests, but
seems to have trouble with the test/run.go regress tests. So add a
GOEXPERIMENT knob to allow another way to turn on unified IR
construction, which plays better with all.bash.

While here, update two existing test expectations that currently fail
during GOEXPERIMENT=unified ./all.bash:

1. misc/cgo/errors/testdata/err2.go is testing column positions, and
types2 gets one case slightly better, and another case slightly
worse. For now, the test case is updated to accept both.

2. fixedbugs/issue42284.go is added to the list of known failures,
because it fails for unified IR. (It's an escape analysis test, and
escape analysis is working as expected; but unified is formatting an
imported constant value differently than the test's regexp expects.)

Updates #46786.

Change-Id: I40a4a70fa1b85ac87fcc85a43687f5d81e011ec0
Reviewed-on: https://go-review.googlesource.com/c/go/+/328215
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2021-06-17 09:09:02 +00:00
Tobias Klauser
97cee43c93 testing: drop unusual characters from TempDir directory name
Only use safe characters of the test name for the os.MkdirTemp pattern.
This currently includes the alphanumeric characters and ASCII
punctuation characters known not to interact with globs.

Fixes #46624

Change-Id: I402c34775b943fed9b97963c52f79245cc16dc1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/326010
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-06-17 04:32:50 +00:00