1
0
mirror of https://github.com/golang/go synced 2024-09-29 18:34:33 -06:00
Commit Graph

51668 Commits

Author SHA1 Message Date
Rhys Hiltner
212bda0669 runtime/pprof: rerun magnitude test on failure
Restructure TestCPUProfileMultithreadMagnitude so it will run again with
a longer duration on failure. Log the split between the user vs system
CPU time that rusage reports.

For #50232

Change-Id: Ice5b38ee7594dbee1eaa5686d32b968c306e3e85
Reviewed-on: https://go-review.googlesource.com/c/go/+/393934
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
2022-03-22 21:31:40 +00:00
Cherry Mui
ac3efc83e6 cmd/link: write output in temp dir in TestUnlinkableObj
For unlinkable object the link will fail, but it opens the output
file in writable mode first then delete it on failure. This fails
if the current directory is not writable. Write to the temporary
directory instead.

Change-Id: Iefd73b5cc8efdc0f11b12edc0920169a8ad3f37c
Reviewed-on: https://go-review.googlesource.com/c/go/+/394755
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-22 21:04:24 +00:00
Paul E. Murphy
946167906e runtime: make static/dynamic startup detection work with musl on ppc64le
The glibc loader explicitly sets the first doubleword on the stack (R1)
to $0 to indicate it was dynamically loaded.

An ELFv2 ABI compliant loader will set R3/R4 to argc/argv when starting
the process, and R13 to TLS. musl is not compliant. Instead it passes
argc/argv like the kernel, but R3/R4 are in an undefined state and R13
is valid.

With the knowledge above, the startup code can be modified to
dynamically handle all three cases when linked internally.

Fixes #51787

Change-Id: I5de33862c161900d9161817388bbc13a65fdc69c
Reviewed-on: https://go-review.googlesource.com/c/go/+/394654
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Paul Murphy <murp@ibm.com>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>
2022-03-22 20:56:39 +00:00
eric fang
817d6ea2b3 runtime: delete useless TPIDR macro on arm64
The TPIDR macro in tls_arm64.h is not used anywhere, so remove it
to reduce confusion.

Change-Id: I04aa5e64ee30753f28f43bc67b44559d81d093c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/373357
Trust: Eric Fang <eric.fang@arm.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-03-22 20:46:22 +00:00
Cherry Mui
77680a0644 cmd/link: simplify content hashed symbol handling
Symbol's content hash used to depend on package path expansion in
symbol names, so we have special logic handling hashed symbols
when path expansion is needed. As we required -p in the compiler
the symbol names are now fully expanded. Remove that logic.

Change-Id: I888574f63ea3789455d96468a6abd500e0958230
Reviewed-on: https://go-review.googlesource.com/c/go/+/394218
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-22 19:39:12 +00:00
Cherry Mui
e853464055 cmd/compile, cmd/link: produce unlinkable object when compile without -p
CL 391014 requires the compiler to be invoked with the -p flag, to
specify the package path. People are used to run "go tool compile"
from the command line with the -p flag. This is mostly for simple
testing, or debugging the compiler. The produced object file is
almost never intended to be linked.

This CL makes the compiler allow "go tool compile" without the -p
flag again. It will produce an unlinkable object. If the linker
sees such an object it will error out.

Change-Id: I7bdb162c3cad61dadd5c456d903b92493a3df20f
Reviewed-on: https://go-review.googlesource.com/c/go/+/394217
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-22 19:38:35 +00:00
Austin Clements
63ea27e9e0 cmd/compile: add short self-link to ABI spec
This makes the short link discoverable.

Change-Id: I9a2f091652bc096feebbbd79a854aa68efe702bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/394634
Trust: Austin Clements <austin@google.com>
Reviewed-by: Eli Bendersky‎ <eliben@golang.org>
2022-03-22 16:51:29 +00:00
Ben Shi
38707059ab A+C: change email of Ben Shi (individual CLA)
Change-Id: Icff75d5fbbeae7aa5003a848ea49b79ddde9933a
GitHub-Last-Rev: 489a69fc6b
GitHub-Pull-Request: golang/go#51869
Reviewed-on: https://go-review.googlesource.com/c/go/+/394595
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
2022-03-22 16:02:31 +00:00
hopehook
eca0d44cec net/http: fix nil body causing ParseMultipartForm to panic
ParseMultipartForm relies on a valid multipartReader, if the request body is nil,
the multipartReader should return an error. This way ParseMultipartForm can return
an error instead of causing mr.ReadForm(maxMemory) to panic

Fixes #48206

Change-Id: Ief906f2340c7ab29cacbd5f56892117202a0b911
Reviewed-on: https://go-review.googlesource.com/c/go/+/384454
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Brad Fitzpatrick <bradfitz@golang.org>
2022-03-22 15:16:23 +00:00
Ian Lance Taylor
96567fb3cc os: skip TestOpenFileLimit on openbsd/mips64
For #46279
For #51713

Change-Id: I444f309999bf5576449a46a9808b23cf6537e7dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/394094
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
2022-03-22 14:34:01 +00:00
Cherry Mui
42d2d5e2b5 cmd/link: delete oReader.flags
Same information is provided from the fields of the embedded
goobj.Reader, and are accessed through it. Delete the flags field.

Change-Id: I7a4f5dca054e567443d719b2931fceff231d6efc
Reviewed-on: https://go-review.googlesource.com/c/go/+/394216
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-03-22 14:16:25 +00:00
Robert Findley
2da1e47fb0 go/types, types: add additional generic cases for the Selections API
Change-Id: Icc5240db7447846061d0d81f5e15f788758d4d64
Reviewed-on: https://go-review.googlesource.com/c/go/+/393372
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-22 13:07:38 +00:00
Byoungchan Lee
a8f019e956 cmd/link: add DT_NEEDED for all 64-bit ELF dynimplib
Also change the relevant test to be tested on the linux-arm64 platform
as well.

Fixes #49789

Change-Id: Id2eac7a45279f037957442862f8ed63838b8e929
Reviewed-on: https://go-review.googlesource.com/c/go/+/366855
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-22 10:00:16 +00:00
Jakub Ciolek
86c8075675 runtime: combine wbuf checks in tryGetFast and putFast
Less text and improves codegen a bit.

compilecmp on ARM64:

runtime
(*gcWork).putFast 160 -> 144  (-10.00%)
(*gcWork).tryGetFast 144 -> 128  (-11.11%)
scanobject 784 -> 752  (-4.08%)
greyobject 800 -> 784  (-2.00%)

AMD64:

runtime
greyobject 765 -> 748  (-2.22%)
(*gcWork).tryGetFast 102 -> 85  (-16.67%)
scanobject 837 -> 820  (-2.03%)
(*gcWork).putFast 102 -> 89  (-12.75%)

Change-Id: I6bb508afe1ba416823775c0bfc08ea9dc21de8a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/393754
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
2022-03-21 22:42:59 +00:00
Robert Griesemer
4b6debaf28 cmd/gofmt: don't descend into /testdata directories in tests (fix long builders)
Now that the go/types and types2 test files end in .go we must
avoid trying to format them as that won't work in general.

Change-Id: I05fdd95a0d26cbe746f6d618b22b48dc1f1ea749
Reviewed-on: https://go-review.googlesource.com/c/go/+/394295
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-21 22:33:09 +00:00
Robert Findley
4a46e6e44c go/types, types2: add an assertion that named type origin is idempotent
For #46794

Change-Id: I19edc19640a2dfa6bc7504dd8e1742a261ba29f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/393368
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-21 22:07:20 +00:00
Matthew Dempsky
adae6ec542 cmd/compile: replace Type.OrigSym with Type.OrigType
First law of cmd/compile frontend development: thou shalt not rely on
types.Sym.

This CL replaces Type.OrigSym with Type.OrigType, which semantically
matches what all of the uses within the frontend actually care about,
and avoids using types.Sym, which invariably leads to mistakes because
symbol scoping in the frontend doesn't work how anyone intuitively
expects it to.

Fixes #51765.

Change-Id: I4affe6ee0718103ce5006ab68aa7e1bb0cac6881
Reviewed-on: https://go-review.googlesource.com/c/go/+/394274
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2022-03-21 21:57:24 +00:00
Robert Griesemer
29866aa2b6 go/types, types2: remove predecl. test functions from ordinary tests
The type checker implements additional built-in functions (assert
and trace) that are useful for debugging. Only permit them in
manual tests (go test -run Manual), not for other tests where they
are not needed.

Change-Id: Idc7723d9e3f6b2c27769b34743561e9d0339565c
Reviewed-on: https://go-review.googlesource.com/c/go/+/393659
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:57 +00:00
Robert Griesemer
4dc5553930 go/types, types2: rename testfile suffixes from .src to .go
Also, manually renamed some irregularly numbered files to
make their file names more regular.

With this rename, all test files now end uniformly in .go.

go fmt doesn't descend into testdata directories, so this
is fine and makes all test files behave like regular .go
files in editors with Go language support.

Change-Id: I3abde32c35c494b94b17787788cd3d7e35662296
Reviewed-on: https://go-review.googlesource.com/c/go/+/393658
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:53 +00:00
Robert Griesemer
82b810f79c go/types, types2: rename testfile suffixes from .go2 to .go
We don't need the distinction anymore.
Also, made corresponding adjustments to check_test.go.

Change-Id: I3c9a768c16a251d76bc6b3ebabd37822773e4ef5
Reviewed-on: https://go-review.googlesource.com/c/go/+/393657
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:48 +00:00
Robert Griesemer
101d14e3b3 go/types, types2: use new flag mechanims to handle importC test
Change-Id: I6f0cb850ee23184380c03a53c12425c350aa16e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/393714
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:43 +00:00
Robert Griesemer
3395f74d86 go/types, types2: implement flexible flag-setting mechanism for tests
Use it so set the language version. Adjust relevant tests.

Fixes #49074.

Change-Id: Ida6d0002bdba65b5add6e8728a1700305de18351
Reviewed-on: https://go-review.googlesource.com/c/go/+/393514
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:39 +00:00
Robert Griesemer
6be52abfa1 go/types, types2: remove mechanism to exclude tests for unified build
The unified build will become the norm and the excluded tests run now.

Change-Id: I0f0873eb73483a4f04736d167d2eb796ee8a857b
Reviewed-on: https://go-review.googlesource.com/c/go/+/393438
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-03-21 19:10:35 +00:00
Robert Griesemer
f2cdc6d167 go/types, types2: improved tracing output throughout (debugging support)
This change fine-tunes tracing output and adds additional
descriptions for delayed actions that were missing tracing.

Change-Id: Ib5e70e8f40ef564194cdb0e8d12c38e15388b987
Reviewed-on: https://go-review.googlesource.com/c/go/+/387919
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:30 +00:00
Robert Griesemer
7751883379 go/types, types2: ensure we have a fully resolved type in validType
This addresses a situation where Named.fromRHS is nil which
is causing validType to panic when the debug flag is set.

Change-Id: Ie1af3f4d412efc2ce2ee7707af5375ed130a1f2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/393436
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:26 +00:00
Robert Griesemer
5df3f491ac go/types, types2: better error msg when using fallthrough in type switch
Fixes #51533.

Change-Id: Ia41a2e96d1ef94f740887e3167e6396e4f52035c
Reviewed-on: https://go-review.googlesource.com/c/go/+/392759
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:22 +00:00
Robert Griesemer
efbff6e43b go/types, types2: re-enable panic if unification stack-overflows
With all the unification/type-inference fixes in place now, we
should not see stack overflows anymore. Re-enable the panic if
we do overflow, so we can address those issues should they arise.

Fixes #51377.

Change-Id: Ied64435ea5936811504cb30bda1126c7d85980f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/392755
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:16 +00:00
Robert Griesemer
3ebb1720d9 go/types, types2: alias type declarations may refer to constraint types
Fixes #51616.

Change-Id: I388a6d91d9bfe5410b5eb32e1606257ec668d618
Reviewed-on: https://go-review.googlesource.com/c/go/+/392715
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:10 +00:00
Robert Griesemer
63c7614fd0 go/types, types2: factor out isInterface(x) && !isTypeParam(x) (cleanup)
Fixes #51581.

Change-Id: I3232428edd7dd86f2930af950fb5841f7394c4e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/391834
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2022-03-21 19:10:06 +00:00
Matthew Dempsky
79103faf2d cmd/compile/internal/types: remove Sym.Block and Sym.Lastlineno
These fields were used for tracking the last scope/position that an
identifier was declared, so that we could report redeclaration
errors. However, redeclaration errors are now diagnosed by types2 (and
typecheck.Redeclared was removed in CL 388537), so these fields can be
safely pruned.

Updates #51691.

Change-Id: Ifd5ea3f6795fadb420913298d59287c95e4669a1
Reviewed-on: https://go-review.googlesource.com/c/go/+/394276
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-03-21 18:58:42 +00:00
Dmitri Shuralyov
d8ce7ae491 build: force GOWORK=off in make.{bash,bat,rc}
While building Go from source, workspace mode should be disabled,
even if the external environment tries to configure it otherwise.

Fixes #51558.

Change-Id: Icd7577860271f59a8f94406214b111280e4b65b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/393879
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2022-03-21 18:58:34 +00:00
Meng Zhuo
b9d6cea501 cmd/link: set alignment of compressed section based on arch
The ELF compression header(Chdr) has Addralign field that is set to the
alignment of the uncompressed section which makes section able to have
a different alignment than the decompressed section. However `file` and
other tools require both Chdr.Addralign and Addralign to be equal.

Ref https://sourceware.org/bugzilla/show_bug.cgi?id=23919
Related #42136

Fixes #51769

Change-Id: I3cf99dbd2359932576420a3c0d342c7e91b99227
Reviewed-on: https://go-review.googlesource.com/c/go/+/393916
Trust: mzh <mzh@golangcn.org>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Fangrui Song <maskray@google.com>
2022-03-21 18:29:06 +00:00
Cherry Mui
b810a74da3 internal/abi, internal/buildcfg: always enable register ABI on PPC64
In last cycle we developed register ABI for ARM64, enabled by
default as a GOEXPERIMENT. This cycle we turn it on all the time.
Later CLs will clean up fallback code.

Change-Id: Idac4dcff634791cbc3d30988052ecd742b55ab8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/394214
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-03-21 18:28:30 +00:00
Cherry Mui
0aaa55526e cmd/vendor: update golang.org/x/tools to c717623e31
To pick up CL 394234.

Done by
	go get -d golang.org/x/tools@c717623e3197
	go mod tidy
	go mod vendor

Change-Id: Ic67a7deb9a22b2679eec895210168f698d8d05eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/394275
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2022-03-21 18:28:15 +00:00
Cuong Manh Le
129a2fcf6c cmd/compile: fix panic with nested dead hidden closures
CL 342350 fixed deadcode panic with dead hidden closures. However, a
closure may contains nested dead hidden closures, so we need to mark
them dead as well.

Fixes #51839

Change-Id: Ib54581adfc1bdea60e74d733cd30fd8e783da983
Reviewed-on: https://go-review.googlesource.com/c/go/+/394079
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-03-21 17:27:41 +00:00
Than McIntosh
627d6d6d55 debug/dwarf: better error detection in parseUnits
Tweak the (*Data).parseUnits method to check a bit more carefully for
buffer read errors, so as to avoid infinite looping on malformed
inputs.

Fixes #51758.
Updates #47653.

Change-Id: I6d67fcb53392acf651ceec636789ab9e49ad5a5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/393874
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-21 17:14:08 +00:00
Cherry Mui
3f8a694155 cmd/compile: remove regabi magic names
When developing register ABI, for early testing the compiler
recognized a few magic names to trigger enabling register ABI.
After the development it is disabled (changed to a name that
cannot be spelled in the source code). Later in the development of
register ABI for ARM64 and PPC64, I don't think the magic names
were used. I think they can now be removed.

Keep the magic pragma for now in case it helps development.

Change-Id: Icbc34e2786a80fd8fffe4a464c569dc03a54cd09
Reviewed-on: https://go-review.googlesource.com/c/go/+/393877
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-03-21 14:46:56 +00:00
Brad Fitzpatrick
7eaad60737 net/http: flesh out Request.SetBasicAuth docs a bit
Clarify that username can't contain a colon.
See https://go.dev/play/p/aM25UHC6n98

Change-Id: I342575107104cbcd28b1d3442c474adf93b7f03c
Reviewed-on: https://go-review.googlesource.com/c/go/+/394115
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-20 21:02:35 +00:00
Jero Bado
6673d5d701 README.md: update links to go.dev
Fixes #50916.

Change-Id: I51f3269b7a0793a3002eef83de1d871111fc3cdc
GitHub-Last-Rev: fc8c183ac7
GitHub-Pull-Request: golang/go#50919
Reviewed-on: https://go-review.googlesource.com/c/go/+/381962
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
2022-03-20 16:05:03 +00:00
zhouguangyuan
47efdcbf4c internal/reflectlite: fix name of type parameter
CL 372774 is for reflect, this CL is for internal/reflectlite.

Updates #50208

Change-Id: Ib7e8b1bc031feab218d1addd78388fcfe9b675b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/393918
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Trust: Daniel Martí <mvdan@mvdan.cc>
2022-03-20 15:54:23 +00:00
Meng Zhuo
4d2da99498 cmd/compile/internal/riscv64: add initial spill support
This CL adds some initial support for spilling and reloading
registers in the new ABI for RISCV64.

Change-Id: I5e2b4d93c33c528809d569e5a442bb302074be78
Reviewed-on: https://go-review.googlesource.com/c/go/+/360215
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: mzh <mzh@golangcn.org>
Run-TryBot: mzh <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-20 03:01:15 +00:00
cuiweixie
fa8efc1347 cmd/compile: pre init shapeMap
Change-Id: I4fea927b9d34e7bf382ddf148a787c1558176f2f
GitHub-Last-Rev: ff1fa78a36
GitHub-Pull-Request: golang/go#50568
Reviewed-on: https://go-review.googlesource.com/c/go/+/377994
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
2022-03-19 23:49:55 +00:00
Meng Zhuo
caf5cd9da8 cmd/compile/internal: add ABI register info for riscv64
This CL adds register information for riscv64

Updates #40724

Change-Id: If2275d9135596ff856d096881e4fe8bd1eeaacb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/359337
Trust: mzh <mzh@golangcn.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: mzh <mzh@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-19 12:47:31 +00:00
Cuong Manh Le
7ca6902c17 cmd/compile: remove n.Diag() deadcode paths
CL 392918 changed n.Diag() to always return false, we can now get rid
of all its deadcode paths.

Updates #51691

Change-Id: I64c07970493e7bdcf89df9508ce88132ef4aa4d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/393915
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-18 23:20:51 +00:00
Cuong Manh Le
da9649e6d9 cmd/compile: remove t.Broke() deadcode paths
CL 392918 changed t.Broke() to always return false, we can now get rid
of all its deadcode paths.

Updates #51691

Change-Id: I0a2a13def07364e780e4785621690452948e219a
Reviewed-on: https://go-review.googlesource.com/c/go/+/393914
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-18 23:20:41 +00:00
Bryan C. Mills
cc2e7f36ba cmd/go: diagnose unset GOROOT when built with -trimpath
For #51483

Change-Id: I4546c20cf968b595020a1eba888fe1d9a1c6cfc5
Reviewed-on: https://go-review.googlesource.com/c/go/+/391811
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Bryan Mills <bcmills@google.com>
2022-03-18 22:42:43 +00:00
Bryan C. Mills
e1fbf13896 cmd/go: include the "-trimpath" flag in the stamped build settings
The -trimpath flag has a strong effect on the resulting binary:
in particular, it determines whether runtime.GOROOT can report
a meaningful path in the absence of an explicit GOROOT environment variable.

For #51461

Change-Id: Id0d55572c0a0a4e2e4724363ed80dfa05b202186
Reviewed-on: https://go-review.googlesource.com/c/go/+/391810
Trust: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-18 22:41:45 +00:00
Bryan C. Mills
0433f5770b cmd/go: stamp build settings for binaries in cmd
Also update cmd/dist to avoid setting gcflags and ldflags explicitly
when the set of flags to be set is empty (a verbose way of specifying
the default behavior).

Stamping was disabled for the Go standard library in CL 356014 due to
the cmd/dist flags causing cmd/go to (correctly) report the resulting
binaries as stale.

With cmd/dist fixed, we can also remove the special case in cmd/go,
which will allow tests of binaries in 'cmd' to read the build info
embedded in the test binary. That build info may be useful to
determine (say) whether runtime.GOROOT ought to work without GOROOT
set in the environment.

For #51483
Updates #37475

Change-Id: I64d04f5990190094eb6c0522db829d3bdfa50ef3
Reviewed-on: https://go-review.googlesource.com/c/go/+/391809
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-18 22:14:22 +00:00
Bryan C. Mills
d68615f64b cmd/go/internal/test: ensure that build.ToolDir is accurate in tests
This fixes a build failure due to inability to locate the "vet" tool
when the test binary is built with -trimpath.

Updates #51461

Change-Id: I81838cc8842e4ff7900cab81af60501ebba86ff1
Reviewed-on: https://go-review.googlesource.com/c/go/+/391808
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-18 22:14:14 +00:00
Bryan C. Mills
6378c0e753 go/build: avoid setting Default.GOROOT when runtime.GOROOT() is empty
Previously, we called path.Clean on the value of runtime.GOROOT() even
if it was empty, which would set it explicitly to ".".
That would cause (*Context).importGo to assume that errors resolving
paths in GOROOT are fatal and return early:
https://cs.opensource.google/go/go/+/master:src/go/build/build.go;l=1121-1127;drc=38174b3a3514629b84dcd76878b2f536b189dd7b

If we instead leave it empty (and are in module mode), then importGo
will fall back to letting the 'go' command resolve the path, which may
succeed if the 'go' command can infer the correct GOROOT (from its own
stamped-in default GOROOT or executable path).

Fixes #51483

Change-Id: I44dce7cec6c3d1c86670e629ddfbca8be461130c
Reviewed-on: https://go-review.googlesource.com/c/go/+/391805
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-18 22:13:57 +00:00