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

57056 Commits

Author SHA1 Message Date
Dmitri Shuralyov
0a68767864 cmd/api: make check even pickier about api/next/*.txt
As spotted in CL 499981, 3 out of 51 of the api/next/*.txt files
ended up with a blank line at the end. It's possible it would've
been more if human reviewers didn't catch them.

Since there's no formatter for these files, the only way to help
catch things is to make the check pickier (as done in CL 431335).
It can be loosened to let in useful blank lines if needed in the
future.

Change-Id: Iae7ee8e782b32707c576150914539ac4cc0faec4
Reviewed-on: https://go-review.googlesource.com/c/go/+/500115
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-06-02 16:04:40 +00:00
Alan Donovan
fdbc66d6dd math/big: rename Int.ToFloat64 to Float64
The "To" prefix was a relic of the first draft
that I failed to make consistent with the unprefixed
name used in the proposal. Fortunately iant spotted
it during the API audit.

Updates #56984
Updates #60560

Change-Id: Ifa6eeddf6dd5f0637c0568e383f9a4bef88b10f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/500116
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Alan Donovan <adonovan@google.com>
2023-06-02 14:22:24 +00:00
Russ Cox
c71cbd544e cmd/go: return more errors from ReadModFile, loadModFile
Return more errors instead of base.Fatalf, so we can handle them
in the callers.

For #57001.

Change-Id: If3e63d3f64188148f5d750991f9cb1175790d89d
Reviewed-on: https://go-review.googlesource.com/c/go/+/499983
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
2023-06-02 02:54:20 +00:00
Roland Shoemaker
40c7be9b0f doc/go1.21: crypto release notes
Updates #58645

Change-Id: Ib7e2baba41bb327d8fc466afb1e117fe2f22e1c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/499637
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
2023-06-01 23:34:15 +00:00
Robert Griesemer
7183e77cc0 go/types, types2: use exact matching when unifying constraint method signatures
Fixes #60556.

Change-Id: I203a0bc79eff607654c3e8350d259e694cb035b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/499995
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
2023-06-01 22:32:26 +00:00
Russ Cox
936ce874ac cmd/go: add gover.Max and gover.MaxToolchain
I've inlined these by hand enough times now.

For #57001.

Change-Id: Ia274bd444f12b07ce14eeb2b5a66546880db8f77
Reviewed-on: https://go-review.googlesource.com/c/go/+/499982
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
2023-06-01 21:32:58 +00:00
Russ Cox
8035de592f cmd/go: add base.Error and base.Fatal
Many many places in the go command use

	base.Errorf("go: %v", err)

or

	base.Fatalf("go: %v", err)

Introduce Error(error) and Fatal(error) to do this
and update all call sites (global search and replace).

The new Error gives us the opportunity to unwrap
a multierror and add the go prefix to each line,
which is the motivation for this change.
(We want to start returning a multierror from LoadModFile
and LoadModGraph.)

For #57001.

Change-Id: I9613653b94808224146077c30d22f814d4e19eed
Reviewed-on: https://go-review.googlesource.com/c/go/+/499980
Auto-Submit: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-01 21:32:23 +00:00
Russ Cox
9f450041c5 cmd/go: move CreateWorkFile from modload to workcmd
In workcmd it can deal with automatic version switching.

For #57001.

Change-Id: I5027690cf744d6d73f87e837c76ea7083ed56aba
Reviewed-on: https://go-review.googlesource.com/c/go/+/499979
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
2023-06-01 21:13:05 +00:00
Russ Cox
459cca5cb2 cmd/go: move version constants from modload to gover
For #57001.

Change-Id: Ia76478b8eaa934b7e1dc1e9cd7fe8a2428fc291a
Reviewed-on: https://go-review.googlesource.com/c/go/+/499978
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
2023-06-01 21:12:04 +00:00
Michael Anthony Knyszek
a38a0839bd api: promote next to go1.21
Change-Id: I30cbd14bd2b3903d7960c5d860d76ce7f3d4730a
Reviewed-on: https://go-review.googlesource.com/c/go/+/499981
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2023-06-01 20:02:28 +00:00
Michael Pratt
d0459766c8 runtime: update skips for TestGdbBacktrace
One issue simply has a reworded message, probably from a new version of
GDB. Another is a new issue.

Fixes #60553.
Fixes #58698.
Updates #39204.

Change-Id: I8389aa981fab5421f57ee761bfb5e1dd237709ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/499975
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2023-06-01 19:44:26 +00:00
Cherry Mui
fdb3dc471d cmd/internal/obj/arm: handle HAUTO etc. in addpool
HAUTO should be handled the same way as other stack offsets for
adding to constant pool. Add the missing cases.

Fixes #57955.

Change-Id: If7fc82cafb2bbf0a6121e73e353b8825cb36b5bc
Reviewed-on: https://go-review.googlesource.com/c/go/+/463138
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-06-01 19:29:08 +00:00
Austin Clements
c2e0bf0abf cmd/internal/testdir: pass if GOEXPERIMENT=cgocheck2 is set
Some testdir tests fail if GOEXPERIMENT=cgocheck2 is set. Fix this by
skipping these tests.

Change-Id: I58d4ef0cceb86bcf93220b4a44de9b9dc4879b16
Reviewed-on: https://go-review.googlesource.com/c/go/+/499675
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2023-06-01 18:30:44 +00:00
Austin Clements
563556ccc7 cmd/cgo/internal/testerrors: pass if GOEXPERIMENT=cgocheck2 is set
The tests in this package are meant to check cgocheck and cgocheck2
mode, so they're of course sensitive to whether they're set.
Currently, the test will set GOEXPERIMENT=cgocheck2 for tests of
cgocheck2 mode, but won't *unset* cgocheck2 mode if it's already in
the environment for tests that expect it to be off. This means

  GOEXPERIMENT=cgocheck2 go test cmd/cgo/internal/testerrors

fails.

Fix this by removing cgocheck2 from GOEXPERIMENT if it's set and the
test case expects it to be unset.

Change-Id: If663e41b791fb89df9940bc5356a566e2a54a77a
Reviewed-on: https://go-review.googlesource.com/c/go/+/499557
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2023-06-01 18:30:29 +00:00
Christian Banse
7dc8509c69 cmd/link/internal/ld: pass correct offset to codesign.Sign
Previously, codesign.Sign was called with Segtext.Fileoff and
Segtext.Filelen. However, both variables do not contain the
complete __TEXT segment, as it excludes padding and header.
Therefore, we now store a reference to the complete segment
in mstext when it is created and pass its offset (which should
always be 0) and filesize to codesign.Sign.

Fixes #59555

Change-Id: Iad88f142705949dcc0b192b811337df9b4be08cf
GitHub-Last-Rev: 37a048d58e
GitHub-Pull-Request: golang/go#59581
Reviewed-on: https://go-review.googlesource.com/c/go/+/484015
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-06-01 17:49:36 +00:00
Ian Lance Taylor
73a29bad0b doc/go1.21: correct links in go/build note
Change-Id: Ie84cad994c1ffb2c91ce45b2dfb9257e6a7f309b
Reviewed-on: https://go-review.googlesource.com/c/go/+/499957
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-01 17:35:10 +00:00
Tobias Klauser
300f24400a doc/go1.21: fix io/fs.ReadDirFS link formatting
Change-Id: I348ac0c0e098f027b8d608a260ee9437d2b77539
Reviewed-on: https://go-review.googlesource.com/c/go/+/499835
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-01 17:29:55 +00:00
Bryan C. Mills
5dd68a3ba7 cmd/go: propagate gover.TooNewError from modload.LoadModGraph
For #57001.

Change-Id: I639190b5f035139ba42a93ca03dd8a4c747556ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/499678
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2023-06-01 17:22:28 +00:00
Eli Bendersky
691b6ca3de doc: remove relnote TODO by merging with another section
This change was already described in the linker section.

Change-Id: I3e36dbd66b3b53c5f0063b0d67d8773383f1f77f
Reviewed-on: https://go-review.googlesource.com/c/go/+/499817
Auto-Submit: Eli Bendersky <eliben@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Bypass: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-01 17:13:46 +00:00
Ian Lance Taylor
990113f3a0 doc/go1.21: reformat flag init change note
It reads better as a single paragraph. Also added links.

Change-Id: Id6ba54111b63fbd536423272f674e0eb64b087a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/499956
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-01 16:14:15 +00:00
Ian Lance Taylor
fecb31f672 doc/go1.21: remove some references to reverted CLs
Change-Id: Id9a8871af9cc3ac26be539877f2eea3462db6f3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/499955
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-01 16:02:44 +00:00
Ian Lance Taylor
a469983943 doc/go1.21: fix type in closing tag
Change-Id: Ibcdedb8222a80c0478f783f4a1800e472dbe062c
Reviewed-on: https://go-review.googlesource.com/c/go/+/499935
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-06-01 16:02:23 +00:00
Eli Bendersky
2ea592c543 doc: add release note for go:wasmimport
Change-Id: I9c6fc4c7e24d0e78086d95dccd61e80bd5ddd856
Reviewed-on: https://go-review.googlesource.com/c/go/+/499815
Auto-Submit: Eli Bendersky‎ <eliben@golang.org>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
TryBot-Bypass: Eli Bendersky‎ <eliben@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-06-01 15:56:20 +00:00
Bryan C. Mills
0a87fdc06e cmd/go/internal/toolchain: avoid importing modcmd
modcmd is a high-level command, but toolchain is a low-level building
block. A dependency from toolchain on modcmd makes it very difficult
to call from other lower-level packages without creating an import
cycle.

Instead, use modfetch.Download in place of modcmd.DownloadModule.

For #57001.

Change-Id: I9694706d7225b269f26dc68814894613a3329abb
Reviewed-on: https://go-review.googlesource.com/c/go/+/499316
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2023-06-01 15:54:37 +00:00
Bryan C. Mills
5f08963b2c cmd/go: fix TestScript/gotoolchain_net when $PATH contains golang.org/dl/go1.20.1
For #57001.

Change-Id: Idcc291c872864bcce7e6d411cdd208db3b331282
Reviewed-on: https://go-review.googlesource.com/c/go/+/499855
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Bypass: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2023-06-01 15:53:59 +00:00
Eli Bendersky
5f695f7072 doc: add release note for cgo error on methods on C types
Change-Id: Ibc5f23f37e5bd45034771a0205eadac3072d6870
Reviewed-on: https://go-review.googlesource.com/c/go/+/499816
TryBot-Bypass: Eli Bendersky <eliben@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Eli Bendersky <eliben@google.com>
2023-06-01 14:43:34 +00:00
Michael Pratt
7911f7c21d runtime: only increment extraMInUse when actually in use
Currently lockextra always increments extraMInUse, even if the M won't
be used (or doesn't even exist), such as in addExtraM. addExtraM fails
to decrement extraMInUse, so it stays elevated forever.

Fix this bug and simplify the model by moving extraMInUse out of
lockextra to getExtraM, where we know the M will actually be used.

While we're here, remove the nilokay argument from getExtraM, which is
always false.

Fixes #60540.

Change-Id: I7a5d97456b3bc6ea1baeb06b5b2975e3b8dd96a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/499677
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-01 14:05:01 +00:00
Michael Pratt
65dcddeb4e doc/go1.21: document PGO GA and devirtualization
For #59959.
For #58645.

Change-Id: I574153ef2fd61a5e90ec281fca065c42fce22cc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/498263
Reviewed-by: Eli Bendersky <eliben@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-01 13:54:10 +00:00
Tobias Klauser
b25dff2efe doc/go1.21: document that os.DirFS implements fs.Read{File,Dir}FS
Also add a missing </a> in the preceding section.

For #53761

Change-Id: I8e64b86b5b32067f954d58cf9adf86cb4d2eeb2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/499735
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Eli Bendersky <eliben@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-06-01 12:43:18 +00:00
Russ Cox
b100e127ca cmd/go: delete cmd/go/internal/slices in favor of slices
Some files already use "slices", others use "cmd/go/internal/slices".
(Some files are using more than slices.Clip and must use "slices".)
Use "slices" consistently and delete cmd/go/internal/slices.

Change-Id: I69ec680106ad2924276f7473e6547a3a907efc96
Reviewed-on: https://go-review.googlesource.com/c/go/+/499715
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
2023-06-01 02:52:19 +00:00
Russ Cox
abdaa0f9aa cmd/go: make toolchain less special in MVS
We were using the omission of toolchain from the MVS graph
as a signal that toolchain was not mentioned on the go get line,
but not including it in the graph causes various problems,
and it may be reintroduced to the graph during operations like
pruning conversion, after which its presence is not a good signal
about whether it was mentioned on the go get command line.
Fix all this irregularity by explicitly telling WriteGoMod whether
the command line mentioned toolchain instead.

For #57001.

Change-Id: I74084637c177c30918fdb114a0d9030cdee7324e
Reviewed-on: https://go-review.googlesource.com/c/go/+/499575
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-06-01 02:51:07 +00:00
Robert Griesemer
1079a5c08a go/types, types2: better error message for some inference failures
For a unification failure involving a constraint, rather than just
reporting (for instance)

        S does not match []E

now report the inferred type for the type parameter, use spec
terminology when referring to the constraint, and print the
constraint in full:

        S (type func()) does not satisfy ~[]E

There's more we can do, but this is better than what we had.

For #60542.

Change-Id: I033369fa0dfc475f0ec0da0582e8cbefb109f3cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/499639
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2023-05-31 22:48:09 +00:00
Ian Lance Taylor
fdd9911d1a doc/go1.21: remove math.Compare TODOs
Change-Id: I975b437240df03da84f2ce7c47f7a0097a597f25
Reviewed-on: https://go-review.googlesource.com/c/go/+/499638
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
2023-05-31 21:57:05 +00:00
Jonathan Amsterdam
0b9348fceb go1.21.html: describe testing/slogtest package
Change-Id: I734aae67d410073056388852cd94776c7483b4b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/498273
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2023-05-31 21:29:18 +00:00
Robert Griesemer
4f51db24f4 doc/go1.21: document type inference changes
For #39661.
For #41176.
For #51593.
For #52397.
For #57192.
For #58645.
For #58650.
For #58671.
For #59338.
For #59750.
For #60353.

Change-Id: Ib731c9f2879beb541f44cb10e40c36a8677d3ad4
Reviewed-on: https://go-review.googlesource.com/c/go/+/499282
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2023-05-31 21:29:10 +00:00
Michael Pratt
01e703c2f6 doc/go1.21: mention improvement to C-to-Go calls
For #51676.
For #58645.

Change-Id: I9045051b5a25c6dfc833eef13e6c105a0d8ae763
Reviewed-on: https://go-review.googlesource.com/c/go/+/499716
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-31 21:27:40 +00:00
Jonathan Amsterdam
eee6f2b921 go1.21.html: remove log/slog package "changes"
Since log/slog doesn't appear in earlier Go versions, we don't need
to document these proposals as changes.

Change-Id: Iae6ed9ca6bd22d8c46c21deece9ddedf7d739032
Reviewed-on: https://go-review.googlesource.com/c/go/+/498272
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
2023-05-31 21:23:25 +00:00
Ian Lance Taylor
bf14663943 Revert "math: add Compare and Compare32"
This reverts CL 467515. Now that we have cmp.Compare,
we don't need math.Compare or math.Compare32 after all.

For #56491
Fixes #60519

Change-Id: I8ed33464adfc6d69bd6b328edb26aa2ee3d234d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/499416
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-05-31 21:19:39 +00:00
Paul E. Murphy
e946f0e1ff cmd/link: support R_PPC64_REL24_P9NOTOC
This can be treated identically to R_PPC64_REL24_NOTOC as stubs
are generated based on GOPPC64 and -buildmode.

Change-Id: I3c42a9bf3c08d107fb656e6bf59b2307783bd9af
Reviewed-on: https://go-review.googlesource.com/c/go/+/497915
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
2023-05-31 20:55:01 +00:00
Tobias Klauser
f07901dc4e doc/go1.21: fix link in WTF-8 section
Change-Id: I8fbba7ca5a148ff6523be412991af0c089e7f7ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/499516
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-31 20:36:31 +00:00
David Chase
7ecd2212e1 runtime: preserve R29 in the write barrier flush path on ppc64
Surprisingly, it usually survived the call to flush a write
barrier.  Usually.

Fixes #60368

Change-Id: I4792a57738e5829c79baebae4d13b62abe9526b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/499679
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2023-05-31 20:23:35 +00:00
Mark Ryan
9552a1122f runtime: fix alignment code in memmove_riscv64.s
The riscv64 implementation of memmove has two optimizations that are
applied when both source and destination pointers share the same alignment
but that alignment is not 8 bytes. Both optimizations attempt to align the
source and destination pointers to 8 byte boundaries before performing 8 byte
aligned loads and stores.  Both optimizations are incorrect.  The first
optimization is applied when the destination pointer is smaller than the source
pointer.  In this case the code increments both pointers by (pointer & 3) bytes
rather than (8 - (pointer & 7)) bytes.  The second optimization is applied
when the destination pointer is larger than the source pointer.  In this
case the existing code decrements the pointers by (pointer & 3) bytes instead
of (pointer & 7).

This commit fixes both optimizations avoiding unaligned 8 byte accesses.
As this particular optimization is not covered by any of the existing
benchmarks a new benchmark, BenchmarkMemmoveUnalignedSrcDst,
is provided that exercises both optimizations. Results of the new
benchmark, which were run on a SiFive HiFive Unmatched A00 with 16GB of RAM
running Ubuntu 23.04 are presented below.

MemmoveUnalignedSrcDst/f_16_0-4            39.48n ±  5%   43.47n ± 2%  +10.13% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_16_0-4            45.39n ±  5%   41.55n ± 4%   -8.47% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_16_1-4          1230.50n ±  1%   83.44n ± 5%  -93.22% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_16_1-4            69.34n ±  4%   67.83n ± 8%        ~ (p=0.436 n=10)
MemmoveUnalignedSrcDst/f_16_4-4          2349.00n ±  1%   72.09n ± 4%  -96.93% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_16_4-4          2357.00n ±  0%   77.61n ± 4%  -96.71% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_16_7-4          1235.00n ±  0%   62.02n ± 2%  -94.98% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_16_7-4          1246.00n ±  0%   84.05n ± 6%  -93.25% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_64_0-4            49.96n ±  2%   50.01n ± 2%        ~ (p=0.755 n=10)
MemmoveUnalignedSrcDst/b_64_0-4            52.06n ±  3%   51.65n ± 3%        ~ (p=0.631 n=10)
MemmoveUnalignedSrcDst/f_64_1-4          8105.50n ±  0%   97.63n ± 1%  -98.80% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_64_1-4            84.07n ±  4%   84.90n ± 5%        ~ (p=0.315 n=10)
MemmoveUnalignedSrcDst/f_64_4-4          9192.00n ±  0%   86.16n ± 3%  -99.06% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_64_4-4          9195.50n ±  1%   91.88n ± 5%  -99.00% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_64_7-4          8106.50n ±  0%   78.44n ± 9%  -99.03% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_64_7-4          8107.00n ±  0%   99.19n ± 1%  -98.78% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_256_0-4           90.95n ±  1%   92.16n ± 8%        ~ (p=0.123 n=10)
MemmoveUnalignedSrcDst/b_256_0-4           96.09n ± 12%   94.90n ± 2%        ~ (p=0.143 n=10)
MemmoveUnalignedSrcDst/f_256_1-4         35492.5n ±  0%   133.5n ± 0%  -99.62% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_256_1-4           128.7n ±  1%   130.1n ± 1%   +1.13% (p=0.005 n=10)
MemmoveUnalignedSrcDst/f_256_4-4         36599.0n ±  0%   123.0n ± 1%  -99.66% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_256_4-4         36675.5n ±  0%   130.7n ± 1%  -99.64% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_256_7-4         35555.5n ±  0%   121.6n ± 2%  -99.66% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_256_7-4         35584.0n ±  0%   139.1n ± 1%  -99.61% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_4096_0-4          956.3n ±  2%   960.8n ± 1%        ~ (p=0.306 n=10)
MemmoveUnalignedSrcDst/b_4096_0-4          1.015µ ±  2%   1.012µ ± 2%        ~ (p=0.076 n=10)
MemmoveUnalignedSrcDst/f_4096_1-4        584.406µ ±  0%   1.002µ ± 1%  -99.83% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_4096_1-4          1.044µ ±  1%   1.040µ ± 2%        ~ (p=0.090 n=10)
MemmoveUnalignedSrcDst/f_4096_4-4       585113.5n ±  0%   988.6n ± 2%  -99.83% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_4096_4-4        586.521µ ±  0%   1.044µ ± 1%  -99.82% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_4096_7-4       585374.5n ±  0%   986.2n ± 0%  -99.83% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_4096_7-4        584.595µ ±  1%   1.055µ ± 0%  -99.82% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_65536_0-4         54.83µ ±  0%   55.00µ ± 0%   +0.31% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_65536_0-4         56.54µ ±  0%   56.64µ ± 0%   +0.19% (p=0.011 n=10)
MemmoveUnalignedSrcDst/f_65536_1-4       9450.51µ ±  0%   58.25µ ± 0%  -99.38% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_65536_1-4         56.65µ ±  0%   56.68µ ± 0%        ~ (p=0.353 n=10)
MemmoveUnalignedSrcDst/f_65536_4-4       9449.48µ ±  0%   58.24µ ± 0%  -99.38% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_65536_4-4       9462.91µ ±  0%   56.69µ ± 0%  -99.40% (p=0.000 n=10)
MemmoveUnalignedSrcDst/f_65536_7-4       9477.37µ ±  0%   58.26µ ± 0%  -99.39% (p=0.000 n=10)
MemmoveUnalignedSrcDst/b_65536_7-4       9467.96µ ±  0%   56.68µ ± 0%  -99.40% (p=0.000 n=10)
geomean                                    11.16µ         509.8n       -95.43%

Change-Id: Idfa1873b81fece3b2b1a0aed398fa5663cc73b83
Reviewed-on: https://go-review.googlesource.com/c/go/+/498377
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2023-05-31 19:56:05 +00:00
Ian Lance Taylor
4406e8ef46 doc/go1.21: mention upgrade to Unicode 15.0.0
For #48621
For #55079

Change-Id: I279b4fbf07d2fa9de9577559a4e17a57f5692aa3
Reviewed-on: https://go-review.googlesource.com/c/go/+/499618
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
2023-05-31 19:15:28 +00:00
Ian Lance Taylor
3cea9e6881 doc/go1.21: document new bytes.Buffer methods
For #53685

Change-Id: I237297d19afeb36ad738074d0c61caa7012f65ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/499617
Reviewed-by: Eli Bendersky <eliben@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
2023-05-31 19:15:27 +00:00
Ian Lance Taylor
481665ec07 doc/go1.21: mention debug/elf changes
For #55107
For #56887
For #56892

Change-Id: Ibcca34c931ed3595d877c4573bba221dec66bb5a
Reviewed-on: https://go-review.googlesource.com/c/go/+/499616
Reviewed-by: Eli Bendersky <eliben@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-31 19:08:24 +00:00
Ian Lance Taylor
077194538c doc/go1.21: reading from debug/pe uninitialized section fails
For #47653

Change-Id: Id44c9dba58966f43f188030a53343d890a6ffde7
Reviewed-on: https://go-review.googlesource.com/c/go/+/499419
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
2023-05-31 16:26:00 +00:00
Ian Lance Taylor
30f8d5b69d doc/go1.21: mention that embedded files implement ReadAt
For #57803

Change-Id: I8e33f4dd3fc3071bfbf4d2848faefbe8488f5742
Reviewed-on: https://go-review.googlesource.com/c/go/+/499418
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-31 16:25:59 +00:00
Ian Lance Taylor
d329fc5b30 doc/go1.21: mention flag.BoolFunc
For #53747

Change-Id: Ia5e2f89c1184f2dfd6d672b838b0dbb579e6c954
Reviewed-on: https://go-review.googlesource.com/c/go/+/499417
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-31 16:25:16 +00:00
Ian Lance Taylor
39bafed102 doc/go1.21: document io/fs formatting functions
Also document the new String methods that call them.

For #54451

Change-Id: I5cd7e0fc6c84097bba6d29c4d6012ed3c8bb1e0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/499177
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-31 16:24:42 +00:00
Ian Lance Taylor
8870c05b60 doc/go1.21: mention directive handling in go/{ast,build}
For #56986
For #59033

Change-Id: I7d03fe34d418aff97a551b236b5d43506e402871
Reviewed-on: https://go-review.googlesource.com/c/go/+/499415
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-31 16:18:26 +00:00