]> Cypherpunks repositories - gostls13.git/log
gostls13.git
6 months agocrypto/internal/fips140test: add counter KDF ACVP tests
Daniel McCarney [Thu, 19 Dec 2024 17:45:57 +0000 (12:45 -0500)]
crypto/internal/fips140test: add counter KDF ACVP tests

Adds ACVP test coverage for the SP 800-108r1 KDF counter mode algorithm
based on the NIST spec:

  https://pages.nist.gov/ACVP/draft-celi-acvp-kbkdf.html

The implementation in our FIPS module fixes some parameters, requiring
tailoring of the advertised capability to match. Notably:

* We only support macModes CMAC-AES-128, -192, and -256
* We only support supportedLengths 256 (matching the [32]byte output
  from CounterKDF.DeriveKey)
* We only support fixedDataOrder "before fixed data"
* We only support counterLength 16

No acvp_test.config.json update accompanies this support because the
ACVP tests for this algorithm aren't amenable to fixed data testing.

Updates #69642

Change-Id: I9e02d6c8cb6e209ac8e4c9fba926fffbad916098
Reviewed-on: https://go-review.googlesource.com/c/go/+/639776
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocrypto/internal/fips140test: add ctr DRBG ACVP tests
Daniel McCarney [Thu, 2 Jan 2025 20:09:39 +0000 (15:09 -0500)]
crypto/internal/fips140test: add ctr DRBG ACVP tests

Adds ACVP test coverage for the SP 800-90A rev 1 ctrDRBG algorithm based
on the NIST spec:
  https://pages.nist.gov/ACVP/draft-vassilev-acvp-drbg.html#section-7.2

The implementation in our FIPS module is a minimal implementation
tailored to the specific needs of stdlib crypto. As a result we
customize the ACVP capability registration so that:

* predResistanceEnabled is false
* only mode AES-256 is supported
* for that mode,
  * derFuncEnabled is false
  * persoStringLen is 0 to disable personalization
  * additionalInputLen is 384 to match the [48]byte argument in our API

Other capability values are chosen based on Table 4's ctrDRBG AES-256
w/o `derFuncEnabled` row:
  https://pages.nist.gov/ACVP/draft-vassilev-acvp-drbg.html#section-7.4

We do enable reseed in the capability, necessitating two acvptool
commands: one that expects only 6 args and doesn't reseed
("ctrDRBG/AES-256"), and one that expects 8 args and does
("ctrDRBG-reseed/AES-256").

Updates #69642

Change-Id: I0f01a2f9496f45b130ee7d10916708093236f473
Reviewed-on: https://go-review.googlesource.com/c/go/+/639795
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agointernal/trace: emit a Sync event even if the next generation is broken
Michael Anthony Knyszek [Mon, 10 Feb 2025 20:10:22 +0000 (20:10 +0000)]
internal/trace: emit a Sync event even if the next generation is broken

Since CL 644215 each Sync event now represents the coming generation,
with a final Sync event emitted even when there's nothing ahead. This
change however failed to emit a Sync event at the end of a completely
valid generation when the next generation was invalid, causing the
runtime test TestCrashWhileTracing to start failing.

Fix this by emitting a final Sync event even when the next generation is
broken. We hold onto the error in parsing the next generation and emit
it after that final Sync event.

(Should these "final" Sync events distinguish themselves in some way?)

Fixes #71615.

Change-Id: I1f8abee5abaa39e1219e6fa05e9f82f1478db4c9
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/648195
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agocrypto/internal/fips140test: add KAS-ECC-SSC ACVP tests
Daniel McCarney [Thu, 19 Dec 2024 19:02:05 +0000 (14:02 -0500)]
crypto/internal/fips140test: add KAS-ECC-SSC ACVP tests

Adds ACVP test coverage for the Sp800-56Ar3 KAS-ECC-SSC algorithm based
on the NIST spec:

  https://pages.nist.gov/ACVP/draft-hammett-acvp-kas-ssc-ecc.html

There's no acvp_test.config.json update for this algorithm as one test
type type requires random key generation and can't be separated from the
test type that doesn't, making it a bad fit for static data testing.

Updates #69642

Change-Id: I3b6538fad1c1e5c8b14b638ff3b933f11e98f75a
Reviewed-on: https://go-review.googlesource.com/c/go/+/637916
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
6 months agocrypto/internal/fips140test: add SSH KDF ACVP tests
Daniel McCarney [Sun, 15 Dec 2024 22:33:48 +0000 (17:33 -0500)]
crypto/internal/fips140test: add SSH KDF ACVP tests

Adds ACVP test coverage for the SP 800-135rev1 SSH KDF based on the NIST
spec:

  https://pages.nist.gov/ACVP/draft-celi-acvp-kdf-ssh.html

Only SHA1, SHA2-224, SHA2-256, SHA2-384, and SHA2-512 are valid hash
algorithms for the SSH KDF algorithm. We do not include SHA-1 since it
is out of scope for our FIPS module.

Similarly only TDES, AES-128, AES-192 and AES-256 are valid ciphers, and
we do not include TDES.

Updates #69642

Change-Id: I70e45b77a91bd8aa631da30fab54c97e974f433c
Reviewed-on: https://go-review.googlesource.com/c/go/+/636355
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>

6 months agocmd/compile: avoid ifaceeq call if we know the interface is direct
Keith Randall [Mon, 9 Dec 2024 20:55:33 +0000 (12:55 -0800)]
cmd/compile: avoid ifaceeq call if we know the interface is direct

We can just use == if the interface is direct.

Fixes #70738

Change-Id: Ia9a644791a370fec969c04c42d28a9b58f16911f
Reviewed-on: https://go-review.googlesource.com/c/go/+/635435
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocmd/compile/internal/gc: handle errors from *bio.Writer
Mateusz Poliwczak [Sat, 8 Feb 2025 13:59:18 +0000 (13:59 +0000)]
cmd/compile/internal/gc: handle errors from *bio.Writer

The error is stored internally in *bio.Writer, more specifically
in *bufio.Writer and the current code does not handle it, ignoring
errors silently.

Change-Id: Iefa9bf7ddabb3c4fc03377e676a8098dcad9be6d
GitHub-Last-Rev: a5d36223312773039c37bb1c52fffc96fff04fba
GitHub-Pull-Request: golang/go#71621
Reviewed-on: https://go-review.googlesource.com/c/go/+/647915
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Keith Randall <khr@golang.org>

6 months agocmd/go/internal/work: allow a bunch of loong64-specific flags
WANG Xuerui [Sun, 9 Feb 2025 10:57:49 +0000 (18:57 +0800)]
cmd/go/internal/work: allow a bunch of loong64-specific flags

Recognize and allow all LoongArch-specific CFLAGS as standardized
in the LoongArch Toolchain Conventions v1.1, and implemented in current
versions of GCC and Clang, to enable advanced cgo use cases on loong64.
These flags are also allowed for linker invocations in case of possible
LTO.

See: https://github.com/loongson/la-toolchain-conventions/blob/releases/v1.1/LoongArch-toolchain-conventions-EN.adoc#list

While at it, also add support for -mtls-dialect as some C programs
may benefit performance-wise from the optional TLSDESC usage. This flag
is not specific to loong64 though; it is available for amd64, arm,
arm64, loong64, riscv64 and x86.

Fixes #71597.

Change-Id: I35d2507edb71fa324ae429a3ae3c739644a9cac1
Reviewed-on: https://go-review.googlesource.com/c/go/+/647956
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
6 months agodatabase/sql: use t.Context in tests
apocelipes [Sat, 8 Feb 2025 01:15:29 +0000 (01:15 +0000)]
database/sql: use t.Context in tests

Replace "context.WithCancel(context.Background())" with "t.Context()".

Updates #36532

Change-Id: I78a8ba422f076f4c697910922cf6dc35c628b1a7
GitHub-Last-Rev: 2eacdbe9ea97ac8d928704c2b605b276626d95dd
GitHub-Pull-Request: golang/go#71599
Reviewed-on: https://go-review.googlesource.com/c/go/+/647555
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agonet/http: use standard time formatting methods
Tom Thorogood [Sun, 9 Feb 2025 02:12:25 +0000 (12:42 +1030)]
net/http: use standard time formatting methods

time.Time has had an AppendFormat method since go1.5 so there's no
need to carry around a custom implementation.

Change-Id: I8e7e5a9ac34e8bf251f5d70555405777ce4e22a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/647955
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

6 months agointernal/trace: merge event and tracev2 packages
Michael Anthony Knyszek [Wed, 29 Jan 2025 17:16:02 +0000 (17:16 +0000)]
internal/trace: merge event and tracev2 packages

These two packages were historically separate in an attempt to provide a
unified description of trace v1 and trace v2 formats. In practice this
turned out to be pointless, since it made more sense to keep the trace
v1 parser in a self-contained bubble with a converter to v2. Future
trace wire format migrations should probably just follow the same
general strategy, if there's a substantial change. (Minor changes can be
handled more organically.)

Change-Id: Ic765df62065fe53cfae59b505297527c3fa42dfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/645395
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
6 months agointernal/trace/internal/testgen: force trace version selection
Michael Anthony Knyszek [Fri, 24 Jan 2025 21:04:01 +0000 (21:04 +0000)]
internal/trace/internal/testgen: force trace version selection

Currently testgen only generates Go 1.22 tests. Allow generating tests
for different versions, especially now that we've tightened up which
events can be emitted by different versions.

Change-Id: Ia64309c6934f34eace03b3229d05fca5acfc7366
Reviewed-on: https://go-review.googlesource.com/c/go/+/644220
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agointernal/trace: be stricter about allowed events in v2 trace versions
Michael Anthony Knyszek [Fri, 24 Jan 2025 20:56:47 +0000 (20:56 +0000)]
internal/trace: be stricter about allowed events in v2 trace versions

Currently all v2 trace versions, Go 1.22 and Go 1.23, share a full set
of specs. This is mostly OK, but it means quite a few events will be
accepted for 1.22 traces that should be rejected. This change fixes that
by limiting which event specs are returned by version.Version.Specs for
Go 1.22.

While we're here, let's be stricter about event names too, and move
tracev2.EventString to be a method on the version, so we can be more
precise. An intended consequence of this move is that tracev2 no longer
depends on fmt, since we will want the runtime to depend on tracev2 in
the near future.

Change-Id: If7285460c8ba59ab73da00993b7b12e61cdfe6a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/644219
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
6 months agointernal/trace: rename go122 to tracev2
Michael Anthony Knyszek [Fri, 24 Jan 2025 20:36:51 +0000 (20:36 +0000)]
internal/trace: rename go122 to tracev2

This change follows up from the previous one which renamed oldtrace to
tracev1, defining everything Go 1.22+ as trace v2.

This change also re-maps some packages in preparation for sharing with
other parts of the standard library, like the runtime. It also cleans up
some other uses of 'go122' that are just a bit misleading. The mappings
are as follows:

- internal/trace/event -> internal/trace/tracev2/event
- internal/trace/event/go122 -> internal/trace/tracev2
- internal/trace/internal/testgen/go122 ->
  internal/trace/internal/testgen

The CL updates all import paths and runs gofmt -w -s on the entire
subdirectory.

Change-Id: I35476c679a96d4eafad6b94bac5f88aa7b085d2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/644218
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoruntime: establish happens-before between goroutine and bubble exit
Damien Neil [Fri, 7 Feb 2025 17:55:15 +0000 (09:55 -0800)]
runtime: establish happens-before between goroutine and bubble exit

synctest.Run waits for all bubbled goroutines to exit before returning.
Establish a happens-before relationship between the bubbled goroutines
exiting and Run returning.

For #67434

Change-Id: Ibda7ec2075ae50838c0851e60dc5b3c6f3ca70fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/647755
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
6 months agoos: hide SetFinalizer from users of Root
Michael Anthony Knyszek [Fri, 7 Feb 2025 23:22:50 +0000 (23:22 +0000)]
os: hide SetFinalizer from users of Root

Currently Root embeds a root and calls SetFinalizer on &r.root. This
sets the finalizer on the outer root, which is visible to users of
os.Root, and thus they can mutate the finalizer attached to it.

This change modifies Root to not embed its inner root, but rather to
refer to it by pointer. This allows us to set the finalizer on this
independent inner object, preventing users of os.Root from changing the
finalizer. This follows the same pattern as os.File's finalizer.

Fixes #71617.

Change-Id: Ibd199bab1b3c877d5e12ef380fd4647b4e10221f
Reviewed-on: https://go-review.googlesource.com/c/go/+/647876
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocrypto/internal/fips140test: add TLS-v1.3 ACVP tests
Daniel McCarney [Sat, 14 Dec 2024 19:36:21 +0000 (14:36 -0500)]
crypto/internal/fips140test: add TLS-v1.3 ACVP tests

Adds ACVP test coverage for the SP 800-56Crev2 IG 2.4.B TLS v1.3 KDF
based on the NIST spec:

  https://pages.nist.gov/ACVP/draft-hammett-acvp-kdf-tls-v1.3.html

Only SHA2-256 and SHA2-384 are valid hash algorithms for the TLS1.3 KDF
algorithm.

The BoringSSL acvptool "lowers" the more complicated TLS 1.3 KDF ACVP
test cases into simple invocations of our module wrapper's pre-existing
HKDF commands, and the new "HKDFExtract/$HASH" and
"HKDFExpandLabel/$HASH" commands added in this branch.

Updates #69642

Change-Id: I5fb1af5b5b33c1845b27cf8968e6523e89bcc589
Reviewed-on: https://go-review.googlesource.com/c/go/+/636117
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 months agocrypto/internal/fips140test: add TLS-v1.2 ACVP tests
Daniel McCarney [Sat, 14 Dec 2024 17:53:29 +0000 (12:53 -0500)]
crypto/internal/fips140test: add TLS-v1.2 ACVP tests

Adds ACVP test coverage for the SP 800-135rev1 RFC 7627 TLS v1.2 KDF
based on the NIST spec:

  https://pages.nist.gov/ACVP/draft-celi-acvp-kdf-tls.html

Only SHA2-256, SHA2-384 and SHA2-512 are valid hash algorithms for the
TLSKDF algorithm.

Updates #69642

Change-Id: I553d4f6a1d6652ed486af0e2c94730c8063fb47f
Reviewed-on: https://go-review.googlesource.com/c/go/+/636116
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
6 months agocrypto/internal/fips140test: add KDA HKDF ACVP tests
Daniel McCarney [Fri, 13 Dec 2024 21:21:45 +0000 (16:21 -0500)]
crypto/internal/fips140test: add KDA HKDF ACVP tests

Adds ACVP test coverage for the SP 800-56Crev2 HKDF KDA based on the
NIST spec:

 https://pages.nist.gov/ACVP/draft-hammett-acvp-kas-kdf-hkdf.html

Updates #69642

Change-Id: Ie4f48f9b0181eaf6c2201a9796d366a31c474eba
Reviewed-on: https://go-review.googlesource.com/c/go/+/636115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
6 months agocrypto/internal/fips140test: add SHAKE-* ACVP tests
Daniel McCarney [Sat, 19 Oct 2024 18:10:28 +0000 (14:10 -0400)]
crypto/internal/fips140test: add SHAKE-* ACVP tests

This commit adds ACVP test coverage for SHAKE-128 and SHAKE-256
based on the NIST spec:

  https://pages.nist.gov/ACVP/draft-celi-acvp-sha3.html

Updates #69642

Change-Id: Ia6899def452fcb63a03603b7919fcb0c3576474b
Reviewed-on: https://go-review.googlesource.com/c/go/+/622395
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
6 months agocmd/compile: mark PCMPEQB as commutative
Jakub Ciolek [Sat, 8 Feb 2025 22:35:51 +0000 (23:35 +0100)]
cmd/compile: mark PCMPEQB as commutative

compilecmp linux/amd64:

internal/runtime/maps
internal/runtime/maps.(*table).Delete changed

internal/runtime/maps [cmd/compile]
internal/runtime/maps.(*Map).Delete changed
internal/runtime/maps.(*table).Delete changed

Change-Id: Ic3c95411c23cab7427e63105170de41e5766f809
Reviewed-on: https://go-review.googlesource.com/c/go/+/647935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>

6 months agocrypto/aes: more precise description for AES keys requirements
Pasha Radchenko [Thu, 6 Feb 2025 18:42:28 +0000 (18:42 +0000)]
crypto/aes: more precise description for AES keys requirements

The existing documentation is not certain in the place regarding requirements about AES key.
Added some notes for precise description.

Change-Id: I190562ab7c1566cce8e7771f9927d738c72880ce
GitHub-Last-Rev: 6565a8f4e5b37220fd14d55e876b809b2d763b7c
GitHub-Pull-Request: golang/go#71589
Reviewed-on: https://go-review.googlesource.com/c/go/+/647336
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
6 months agocmd/internal/bio: remove unused MustWriter
Mateusz Poliwczak [Sat, 8 Feb 2025 13:51:31 +0000 (13:51 +0000)]
cmd/internal/bio: remove unused MustWriter

Change-Id: I70435781fbaeca2b6927a74afd79a3ff123b527b
GitHub-Last-Rev: cae569f4c4bf73a9a6cd8d26fb080962f94bf1b1
GitHub-Pull-Request: golang/go#71622
Reviewed-on: https://go-review.googlesource.com/c/go/+/647916
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>

6 months agotext/template: handle UnsafePointer in isTrue
pgxiaolianzi [Fri, 7 Feb 2025 08:37:50 +0000 (08:37 +0000)]
text/template: handle UnsafePointer in isTrue

Change-Id: I4d0b5919d109f768ba04ab519e8f948a5749a752
GitHub-Last-Rev: 6f27f1193c21bb10e3b81660b4271f2c1f33be1e
GitHub-Pull-Request: golang/go#70520
Reviewed-on: https://go-review.googlesource.com/c/go/+/631076
Run-TryBot: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

6 months agocrypto/internal/fips140test: add CMAC-AES ACVP tests
Daniel McCarney [Fri, 13 Dec 2024 19:17:48 +0000 (14:17 -0500)]
crypto/internal/fips140test: add CMAC-AES ACVP tests

Adds ACVP test coverage for CMAC-AES based on the NIST spec:
  https://pages.nist.gov/ACVP/draft-fussell-acvp-mac.html

Updates #69642

Change-Id: Ie731863b84c6f8d74c64daa6a6848354420151b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/635762
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agobytes: use "subslice" instead of "substring" in doc comments
Cherry Mui [Fri, 7 Feb 2025 22:42:02 +0000 (17:42 -0500)]
bytes: use "subslice" instead of "substring" in doc comments

The bytes package iterators return subslices, not substrings.

Updates #61901.

Change-Id: Ida91d3e33a0f178edfe9a267861adf4f13f9a965
Reviewed-on: https://go-review.googlesource.com/c/go/+/647875
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocmd/compile: don't merge symbols on riscv64 when dynamic linking
Meng Zhuo [Thu, 12 Sep 2024 11:46:20 +0000 (19:46 +0800)]
cmd/compile: don't merge symbols on riscv64 when dynamic linking

Each plugin is compiled as a separate shared object,
with its own symbol table. When dynamic linking plugin symbols
are resolved within the plugin's scope, not globally merged to
avoid conflicts.

Change-Id: I9e6986085855c17fbd6c39b937cb6129d216f5e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/435015
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agogo/types, types2: better error messages for channel sends and receives
Robert Griesemer [Thu, 6 Feb 2025 21:51:51 +0000 (13:51 -0800)]
go/types, types2: better error messages for channel sends and receives

Use the same code pattern for sends and receives and factor it out
into a new helper method Checker.chanElem.

Provide the exact error cause rather than simply referring to the
core type.

For #70128.

Change-Id: I4a0b597a487b78c057eebe06c4ac28f9bf1f7719
Reviewed-on: https://go-review.googlesource.com/c/go/+/647455
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoos: improve comments for process support, minor code cleanup
Ian Lance Taylor [Mon, 23 Dec 2024 19:44:42 +0000 (11:44 -0800)]
os: improve comments for process support, minor code cleanup

Change-Id: I97ecbc6fc0c73c6d8469144f86a7ad8c2655a658
Reviewed-on: https://go-review.googlesource.com/c/go/+/638581
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agoos: simplify Process.Release
Ian Lance Taylor [Mon, 23 Dec 2024 19:27:13 +0000 (11:27 -0800)]
os: simplify Process.Release

Consolidate release/deactivation into a single doRelease method.
It needs to check GOOS for backward compatibility, but it's
simpler to keep all the logic in one place.

Change-Id: I242eb084d44d2682f862a8fbf55c410fb8c53358
Reviewed-on: https://go-review.googlesource.com/c/go/+/638580
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agoos: use AddCleanup, not SetFinalizer, for Process
Ian Lance Taylor [Mon, 23 Dec 2024 05:23:55 +0000 (21:23 -0800)]
os: use AddCleanup, not SetFinalizer, for Process

There is no reason to use a cleanup/finalizer for a Process that
doesn't use a handle, because Release doesn't change anything visible
about the process.

For #70907

Change-Id: I3b92809175523ceee2e07d601cc2a8e8b86321e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/638579
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 months agointernal/trace: rename "oldtrace" to trace v1
Michael Anthony Knyszek [Fri, 24 Jan 2025 20:17:20 +0000 (20:17 +0000)]
internal/trace: rename "oldtrace" to trace v1

This is part of a refactoring to better distinguish trace wire format
versions. Even though details may change between Go versions and they
might be backwards-incompatible, the trace format still broadly has two
wire formats: v1 and v2.

A follow-up change will rename go122 to v2 to make this more consistent.

Change-Id: If4fe1c82d8aeabc8baa05f525e08a9e7d469a5c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/644217
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
6 months agointernal/trace: move SchedReqs out of events package
Michael Anthony Knyszek [Fri, 24 Jan 2025 18:10:31 +0000 (18:10 +0000)]
internal/trace: move SchedReqs out of events package

It's only used by order.go; there's no reason for it to be in a shared
package.

Change-Id: If99df075089e6f6e37a78b12e64a1b81a556331c
Reviewed-on: https://go-review.googlesource.com/c/go/+/644216
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
6 months agointernal/trace: refactor how experimental batches are exposed
Michael Anthony Knyszek [Thu, 9 Jan 2025 18:17:49 +0000 (18:17 +0000)]
internal/trace: refactor how experimental batches are exposed

This change modifies how per-generation experimental batches are
exposed. Rather than expose them on the ExperimentalEvent, it exposes it
as part of the Sync event, so it's clear to the caller when the
information becomes relevant and when it should be parsed.

This change also adds a field to each ExperimentalEvent indicating which
experiment the event is a part of.

Because this information needs to appear *before* a generation is
observed, we now ensure there is a sync event both before and after each
generation. This means the final sync event is now a special case;
previously we would only emit a sync event after each generation.

This change is based on feedback from Austin Clements on the
experimental events functionality.

For #62627.

Change-Id: I48b0fe12b22abb7ac8820a9e73447bfed8419856
Reviewed-on: https://go-review.googlesource.com/c/go/+/644215
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agobufio: skip network test if unixpacket socket not supported
Ian Lance Taylor [Fri, 7 Feb 2025 02:04:00 +0000 (18:04 -0800)]
bufio: skip network test if unixpacket socket not supported

Change-Id: I03434fdc4916fc8d195de2617edc28ec4b66a172
Reviewed-on: https://go-review.googlesource.com/c/go/+/647535
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
6 months agotesting/synctest: add an example of testing networked code
Damien Neil [Thu, 30 Jan 2025 18:55:36 +0000 (10:55 -0800)]
testing/synctest: add an example of testing networked code

For #67434

Change-Id: If7dcd3bf7bb69e1730856405d55cffc72ce0e132
Reviewed-on: https://go-review.googlesource.com/c/go/+/645675
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>

6 months agomake.bat: pass through all arguments to "dist bootstrap"
qmuntal [Thu, 6 Feb 2025 10:13:19 +0000 (11:13 +0100)]
make.bat: pass through all arguments to "dist bootstrap"

nolocal is (almost) no longer needed after CL 647115. If we remove it,
then we can pass through all arguments to the Go command, which is
useful for running tests with additional flags, like -json or -v.

This CL also updates all.bat to use "go tool dist" instead of
"%GOTOOLDIR%/dist", as %GOTOOLDIR% is no longer set after making
make.bat uncoditionally set nolocal.

Change-Id: I97dc687faa5686d023f7d7d2b96637295995fe67
Reviewed-on: https://go-review.googlesource.com/c/go/+/647117
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months ago{all,clean,make,race,run}.bat: use || instead of "if errorlevel 1"
qmuntal [Thu, 6 Feb 2025 09:55:59 +0000 (10:55 +0100)]
{all,clean,make,race,run}.bat: use || instead of "if errorlevel 1"

"if errorlevel 1" is and old construct that returns true if the
errorlevel is greater than or equal to 1. There are better alternatives
since Windows NT. For example, the || operator runs the RHS operand if
the preceding command failed, determined by checking that the errorlevel
is different from 0. This approach is more robust -it also works with
negative errorlevels- and is less verbose.

Change-Id: I2070d654d8f9dd41a6cd586ba5ad5f4fea0638ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/647136
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
6 months agocrypto/internal/fips140test: add AES ACVP tests
Daniel McCarney [Wed, 11 Dec 2024 19:48:00 +0000 (14:48 -0500)]
crypto/internal/fips140test: add AES ACVP tests

Adds ACVP AES test coverage for:

* AES CBC
* AES CTR
* AES GCM (both internal & external iv gen)

For AES key sizes of 128, 192, and 256 bits, based on the NIST spec:

  https://pages.nist.gov/ACVP/draft-celi-acvp-symmetric.html

ECB mode is excluded based on upcoming policy changes forbidding its
use.

Internal IV gen is excluded from the go-acvp static test data since it's
non-deterministic based on the DRBG.

Updates #69642

Change-Id: I34f471725e2f1a2f5d32ab9877bde153abf2db0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/627655
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
6 months agocrypto/internal/fips140test: add DetECDSA ACVP tests
Daniel McCarney [Wed, 11 Dec 2024 21:31:22 +0000 (16:31 -0500)]
crypto/internal/fips140test: add DetECDSA ACVP tests

Adds ACVP test coverage for deterministic ECDSA based on the NIST spec:
  https://pages.nist.gov/ACVP/draft-fussell-acvp-ecdsa.html

Notably there is no corresponding acvp_test.config.json update in this
commit because ACVP DetECDSA only specifies sigGen mode.

The ACVP ECDSA sigGen tests are not amenable to testing against
static data because the test vectors don't provide a key pair to use for
the signature, just the message. The module wrapper has to generate its
own keypair and return the public key components with the signature.
DetECDSA produces deterministic signatures only when signing the same
message with the same key.

Change-Id: I9921f52e943c96b32e02e79cb5556ba0fabeae17
Reviewed-on: https://go-review.googlesource.com/c/go/+/635341
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 months agocrypto/internal/fips140test: add ECDSA ACVP tests
Daniel McCarney [Thu, 14 Nov 2024 20:54:54 +0000 (15:54 -0500)]
crypto/internal/fips140test: add ECDSA ACVP tests

This commit adds ACVP test coverage for the non-deterministic ECDSA
vectors (keyGen, keyVer, sigGen, sigVer) based on the NIST spec:

  https://pages.nist.gov/ACVP/draft-fussell-acvp-ecdsa.html

Updates #69642

Change-Id: Iec8b18a247b0a652d13f9167a78de2cb74f4dfd0
Reviewed-on: https://go-review.googlesource.com/c/go/+/620935
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agocrypto/internal/fips140test: add EDDSA ACVP tests
Daniel McCarney [Thu, 14 Nov 2024 21:00:43 +0000 (16:00 -0500)]
crypto/internal/fips140test: add EDDSA ACVP tests

This commit adds ACVP test coverage for EDDSA (Ed25519, and
HashEd25519/Ed25519ph) for the keyGen, keyVer, sigGen, and sigVer
capabilities.

Updates #69642

Change-Id: I5122d86180bd4d2f7d94570a6dc939808aa24fc4
Reviewed-on: https://go-review.googlesource.com/c/go/+/621135
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agoRevert "cmd/go: report gcc ld error message when linking fails"
Quim Muntal [Thu, 6 Feb 2025 21:16:34 +0000 (13:16 -0800)]
Revert "cmd/go: report gcc ld error message when linking fails"

This reverts CL 646315.

Reason for revert: broke cgo_undef test

Change-Id: Ic992a1666a446736c605a8caefa77f791dceb64c
Reviewed-on: https://go-review.googlesource.com/c/go/+/647415
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocrypto/internal/fips140/edwards25519/field: speed up Element.Bytes
Alexander Yastrebov [Fri, 7 Feb 2025 11:29:34 +0000 (11:29 +0000)]
crypto/internal/fips140/edwards25519/field: speed up Element.Bytes

Write bytes in 64-bit chunks made from adjacent limbs.

goos: linux
goarch: amd64
pkg: crypto/internal/fips140/edwards25519/field
cpu: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
        │   HEAD~1    │                HEAD                 │
        │   sec/op    │   sec/op     vs base                │
Bytes-8   76.14n ± 3%   13.61n ± 3%  -82.13% (p=0.000 n=10)

        │   HEAD~1   │              HEAD              │
        │    B/op    │    B/op     vs base            │
Bytes-8   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

        │   HEAD~1   │              HEAD              │
        │ allocs/op  │ allocs/op   vs base            │
Bytes-8   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

Change-Id: Iaecc32da7fd8df96ff048e1e855a990f44dc9db5
GitHub-Last-Rev: d0e1583a4faf8cc3471af03437107cc0e5770d57
GitHub-Pull-Request: golang/go#71603
Reviewed-on: https://go-review.googlesource.com/c/go/+/647595
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>

6 months agorun.bat: pass through all arguments to "go tool dist test"
qmuntal [Thu, 6 Feb 2025 08:19:20 +0000 (09:19 +0100)]
run.bat: pass through all arguments to "go tool dist test"

nolocal is no longer needed after CL 647115. If we remove it, then
we can pass through all arguments to the Go command, which is
useful for running tests with additional flags, like -json or -v.

Change-Id: I5c48d9b90720c039bf2ec3d9213e7ce5cea33818
Reviewed-on: https://go-review.googlesource.com/c/go/+/647116
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months ago{all,clean,make,race,run}.bat: remove %GOBUILDEXIT% and %GOBUILDFAIL%
qmuntal [Thu, 6 Feb 2025 08:07:08 +0000 (09:07 +0100)]
{all,clean,make,race,run}.bat: remove %GOBUILDEXIT% and %GOBUILDFAIL%

%GOBUILDEXIT% is used to avoid closing the terminal window when the
build or the tests fail on a dev machine. It is only set in CI to get
a non-zero exit code in case of failure.

%GOBUILDFAIL% is used to pass the exit code from a child batch file to
the parent batch file. It is set to 1 in the child batch file if the
build or the tests fail.

These two variables add complexity to the batch files and impose some
limitations on how they are implemented. For example, the child files
can't use setlocal, as it would make the parent file unable to read the
%GOBUILDFAIL% variable.

This CL removes these two variables and replaces them with unconditional
calls to "exit /b 1" in case of failure, which is more idiomatic and
composable. The trick is that the "/b" parameter makes the exit only
apply to the current batch file, not the entire shell session (unless
the bat file is the root, in which case the parameter is ignored), so
the parent batch file can continue executing, potentially checking the
errorlevel of the child batch file (which we always set to 1).

Change-Id: Ib053fb181ab14d58679551e03485700de77878d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/647115
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
6 months agocmd/internal/obj/riscv: update references to RISC-V specification
Joel Sing [Sun, 24 Nov 2024 03:38:33 +0000 (14:38 +1100)]
cmd/internal/obj/riscv: update references to RISC-V specification

Update references to version 20240411 of the RISC-V specifications.
Reorder and regroup instructions to maintain ordering. Also be
consistent with formatting.

The instruction encodings table was seemingly missed in CL 616115.

Change-Id: I47b7c8538383ff3b0503ba59db570c3d4f0d5653
Reviewed-on: https://go-review.googlesource.com/c/go/+/631935
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Pengcheng Wang <wangpengcheng.pp@bytedance.com>
6 months agocrypto/internal/fips140/subtle: combine xor_<goarch>.go files
Joel Sing [Fri, 3 Jan 2025 08:06:13 +0000 (19:06 +1100)]
crypto/internal/fips140/subtle: combine xor_<goarch>.go files

There is not much point in having per architecture files that all contain
the same content. Instead, merge the various xor_<goarch>.go files into a
single xor_asm.go file that has appropriate build tags.

Change-Id: I555d44b2fd83f260a4855d83cacb9e101d689bc0
Reviewed-on: https://go-review.googlesource.com/c/go/+/639856
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
6 months agocrypto/subtle: add additional benchmarks for XORBytes
Joel Sing [Fri, 3 Jan 2025 08:06:07 +0000 (19:06 +1100)]
crypto/subtle: add additional benchmarks for XORBytes

Provide alignment benchmarks for XORBytes, as well as including
8192 byte blocks in the existing benchmarks. This allows us to
better evaluate performance with unaligned inputs.

Change-Id: Iad497c594c0425389ae02ca848aede5cb0ac3afd
Reviewed-on: https://go-review.googlesource.com/c/go/+/639316
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
6 months agocmd/link: add -e (no limit on errors) flag
qmuntal [Tue, 4 Feb 2025 10:16:40 +0000 (11:16 +0100)]
cmd/link: add -e (no limit on errors) flag

The compiler and assembler have a -e flag that disables the limit
on the number of errors before the build fails. This flag is useful
for debugging, the linker should have it too.

Change-Id: I892cfd6ee1519e9e86261af7d05e1af2ded21684
Reviewed-on: https://go-review.googlesource.com/c/go/+/646435
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoos: simplify process status
Ian Lance Taylor [Mon, 23 Dec 2024 05:15:30 +0000 (21:15 -0800)]
os: simplify process status

Since it no longer holds a reference count, just use values.

For #70907

Change-Id: I19a42583988d4f8a9133b1c837356ca0179d688c
Reviewed-on: https://go-review.googlesource.com/c/go/+/638578
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
6 months agoos: don't store reference count in Process.state
Ian Lance Taylor [Mon, 23 Dec 2024 05:00:58 +0000 (21:00 -0800)]
os: don't store reference count in Process.state

We only need a reference count in processHandle.

For #70907
Fixes #71564

Change-Id: I209ded869203dea10f12b070190774fb5f1d3d71
Reviewed-on: https://go-review.googlesource.com/c/go/+/638577
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

6 months agolib/time: build with Ubuntu backward compatibility options
Ian Lance Taylor [Mon, 27 Jan 2025 18:21:57 +0000 (10:21 -0800)]
lib/time: build with Ubuntu backward compatibility options

Change-Id: I7e241eb602e45eea3c730793c14d8a5f666f9181
Reviewed-on: https://go-review.googlesource.com/c/go/+/644077
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

6 months agobufio: don't do empty Write at start of WriteTo
Ian Lance Taylor [Mon, 27 Jan 2025 05:52:58 +0000 (21:52 -0800)]
bufio: don't do empty Write at start of WriteTo

The empty Write will cause the wrong thing to happen when using
io.Copy to copy to a package-based stream.

Fixes #71424

Change-Id: I046a27539447182692ac76a8bdd422327345dd8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/644535
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
6 months agoencoding/base64: use internal/byteorder
Ian Lance Taylor [Thu, 9 Jan 2025 22:42:16 +0000 (14:42 -0800)]
encoding/base64: use internal/byteorder

This permits us to remove the dependency on reflect.

Change-Id: I60b1e9fd713f340bfd5eec2edfa58fc724a8e2d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/641936
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

6 months agocrypto/internal/fips140/drbg: add package comment
Ian Lance Taylor [Tue, 7 Jan 2025 18:47:01 +0000 (10:47 -0800)]
crypto/internal/fips140/drbg: add package comment

For #69536

Change-Id: I70d2ed10555fed244f08c898899399e3032e17b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/640597
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>

6 months agocmd/go: adjust testsuite to add reraised panic message
Ian Lance Taylor [Thu, 6 Feb 2025 23:01:17 +0000 (15:01 -0800)]
cmd/go: adjust testsuite to add reraised panic message

A couple of tests generate different output due to CL 645916
for issue #71517.

Fixes #71593
Fixes #71594

Change-Id: Ifaeff4e9de8d881202bd9e6394c9b9cff8959596
Reviewed-on: https://go-review.googlesource.com/c/go/+/647495
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
6 months agounicode/utf8: remove init from utf8_test
Luka Krmpotic [Thu, 6 Feb 2025 21:33:18 +0000 (21:33 +0000)]
unicode/utf8: remove init from utf8_test

TestConstants and init test the same thing, remove init,
it does not exist in utf16_test.go either.

Fixes #71579

Change-Id: Ie0afd640bebde822733b6eac0bf98a17872f4e5f
GitHub-Last-Rev: d7224c18376e00038261279abdfa954abc3a8303
GitHub-Pull-Request: golang/go#71582
Reviewed-on: https://go-review.googlesource.com/c/go/+/647335
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoweak: prevent unsafe conversions using weak pointers
thepudds [Thu, 6 Feb 2025 13:07:38 +0000 (08:07 -0500)]
weak: prevent unsafe conversions using weak pointers

Prevent conversions between Pointer types,
like we do for sync/atomic.Pointer.

Fixes #71583

Change-Id: I20e83106d8a27996f221e6cd9d52637b0442cea4
Reviewed-on: https://go-review.googlesource.com/c/go/+/647195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agoruntime: don't duplicate reraised panic values in printpanics
Damien Neil [Fri, 31 Jan 2025 23:03:15 +0000 (15:03 -0800)]
runtime: don't duplicate reraised panic values in printpanics

Change the output printed when crashing with a reraised panic value
to not duplicate that value.

Changes output of panicking with "PANIC", recovering, and reraising
from:

  panic: PANIC [recovered]
    panic: PANIC

to:

  panic: PANIC [recovered, reraised]

Fixes #71517

Change-Id: Id59938c4ea0df555b851ffc650fe6f94c0845499
Reviewed-on: https://go-review.googlesource.com/c/go/+/645916
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocmd/cgo: use strings.Builder to build long strings
Ian Lance Taylor [Thu, 26 Dec 2024 00:01:58 +0000 (16:01 -0800)]
cmd/cgo: use strings.Builder to build long strings

Change-Id: I33ba7c8a7b731647cdff3ffe7c4274f76f8923ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/638736
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
6 months agonet: fix ListenMulitcastUDP to work properly when interface has no IPv4
Jesse Rittner [Sat, 25 Jan 2025 21:21:53 +0000 (16:21 -0500)]
net: fix ListenMulitcastUDP to work properly when interface has no IPv4

The existing implementation would either fail or bind to the wrong interface
when the requested interface had no IPv4 address, such as when the Ethernet cable
was unplugged.

Now on Linux, it will always bind to the requested interface.
On other operating systems, it will consistently fail if the requested interface
has no IPv4 address.

Fixes #70132

Change-Id: I22ec7f9d4adaa4b5afb21fc448050fb4219cacee
Reviewed-on: https://go-review.googlesource.com/c/go/+/644375
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

6 months agocmd/go: report gcc ld error message when linking fails
qmuntal [Mon, 3 Feb 2025 20:05:51 +0000 (21:05 +0100)]
cmd/go: report gcc ld error message when linking fails

The output of the gcc ld command is useful to understand why a package
that uses cgo can't use internal linking. We should log it.

Change-Id: Id524065fc5348be57387f2b67d1e00861f9adf15
Reviewed-on: https://go-review.googlesource.com/c/go/+/646315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
6 months agocmd/compile: prefer an add when shifting left by 1
Jakub Ciolek [Sat, 11 Jan 2025 18:26:57 +0000 (19:26 +0100)]
cmd/compile: prefer an add when shifting left by 1

ADD(Q|L) has generally twice the throughput.

Came up in CL 626998.

Throughput by arch:

Zen 4:

SHLL (R64, 1):   0.5
ADD  (R64, R64): 0.25

Intel Alder Lake:

SHLL (R64, 1):   0.5
ADD  (R64, R64): 0.2

Intel Haswell:

SHLL (R64, 1):   0.5
ADD  (R64, R64): 0.25

Also include a minor opt for:

(x + x) << c -> x << (c + 1)

Before this, the code:

func addShift(x int64) int64 {
    return (x + x) << 1
}

emitted two instructions:

        ADDQ    AX, AX
        SHLQ    $1, AX

but we can do it in a single shift:

        SHLQ    $2, AX

Add a codegen test for clearing the last bit.

compilecmp linux/amd64:

math
math.sqrt 243 -> 242  (-0.41%)

math [cmd/compile]
math.sqrt 243 -> 242  (-0.41%)

runtime
runtime.selectgo 5455 -> 5445  (-0.18%)
runtime.sysargs 665 -> 662  (-0.45%)
runtime.isPinned 145 -> 141  (-2.76%)
runtime.atoi64 198 -> 194  (-2.02%)
runtime.setPinned 714 -> 709  (-0.70%)

runtime [cmd/compile]
runtime.sysargs 665 -> 662  (-0.45%)
runtime.setPinned 714 -> 709  (-0.70%)
runtime.atoi64 198 -> 194  (-2.02%)
runtime.isPinned 145 -> 141  (-2.76%)

strconv
strconv.computeBounds 109 -> 107  (-1.83%)
strconv.FormatInt 201 -> 197  (-1.99%)
strconv.ryuFtoaShortest 1298 -> 1266  (-2.47%)
strconv.small 144 -> 134  (-6.94%)
strconv.AppendInt 357 -> 344  (-3.64%)
strconv.ryuDigits32 490 -> 488  (-0.41%)
strconv.AppendUint 342 -> 340  (-0.58%)

strconv [cmd/compile]
strconv.FormatInt 201 -> 197  (-1.99%)
strconv.ryuFtoaShortest 1298 -> 1266  (-2.47%)
strconv.ryuDigits32 490 -> 488  (-0.41%)
strconv.AppendUint 342 -> 340  (-0.58%)
strconv.computeBounds 109 -> 107  (-1.83%)
strconv.small 144 -> 134  (-6.94%)
strconv.AppendInt 357 -> 344  (-3.64%)

image
image.Rectangle.Inset 101 -> 97  (-3.96%)

regexp/syntax
regexp/syntax.inCharClass.func1 111 -> 110  (-0.90%)
regexp/syntax.(*compiler).quest 586 -> 573  (-2.22%)
regexp/syntax.ranges.Less 153 -> 150  (-1.96%)
regexp/syntax.(*compiler).loop 583 -> 568  (-2.57%)

time
time.Time.Before 179 -> 161  (-10.06%)
time.Time.Compare 189 -> 166  (-12.17%)
time.Time.Sub 444 -> 425  (-4.28%)
time.Time.UnixMicro 106 -> 95  (-10.38%)
time.div 592 -> 587  (-0.84%)
time.Time.UnixNano 85 -> 78  (-8.24%)
time.(*Time).UnixMilli 141 -> 140  (-0.71%)
time.Time.UnixMilli 106 -> 95  (-10.38%)
time.(*Time).UnixMicro 141 -> 140  (-0.71%)
time.Time.After 179 -> 161  (-10.06%)
time.Time.Equal 170 -> 150  (-11.76%)
time.Time.AppendBinary 766 -> 757  (-1.17%)
time.Time.IsZero 74 -> 66  (-10.81%)
time.(*Time).UnixNano 124 -> 113  (-8.87%)
time.(*Time).IsZero 113 -> 108  (-4.42%)

regexp
regexp.(*Regexp).FindAllStringSubmatch.func1 590 -> 569  (-3.56%)
regexp.QuoteMeta 485 -> 469  (-3.30%)

regexp/syntax [cmd/compile]
regexp/syntax.inCharClass.func1 111 -> 110  (-0.90%)
regexp/syntax.(*compiler).loop 583 -> 568  (-2.57%)
regexp/syntax.(*compiler).quest 586 -> 573  (-2.22%)
regexp/syntax.ranges.Less 153 -> 150  (-1.96%)

encoding/base64
encoding/base64.decodedLen 92 -> 90  (-2.17%)
encoding/base64.(*Encoding).DecodedLen 99 -> 97  (-2.02%)

time [cmd/compile]
time.(*Time).IsZero 113 -> 108  (-4.42%)
time.Time.IsZero 74 -> 66  (-10.81%)
time.(*Time).UnixNano 124 -> 113  (-8.87%)
time.Time.UnixMilli 106 -> 95  (-10.38%)
time.Time.Equal 170 -> 150  (-11.76%)
time.Time.UnixMicro 106 -> 95  (-10.38%)
time.(*Time).UnixMicro 141 -> 140  (-0.71%)
time.Time.Before 179 -> 161  (-10.06%)
time.Time.UnixNano 85 -> 78  (-8.24%)
time.Time.AppendBinary 766 -> 757  (-1.17%)
time.div 592 -> 587  (-0.84%)
time.Time.After 179 -> 161  (-10.06%)
time.Time.Compare 189 -> 166  (-12.17%)
time.(*Time).UnixMilli 141 -> 140  (-0.71%)
time.Time.Sub 444 -> 425  (-4.28%)

index/suffixarray
index/suffixarray.sais_8_32 1677 -> 1645  (-1.91%)
index/suffixarray.sais_32 1677 -> 1645  (-1.91%)
index/suffixarray.sais_64 1677 -> 1654  (-1.37%)
index/suffixarray.sais_8_64 1677 -> 1654  (-1.37%)
index/suffixarray.writeInt 249 -> 247  (-0.80%)

os
os.Expand 1070 -> 1051  (-1.78%)
os.Chtimes 787 -> 774  (-1.65%)

regexp [cmd/compile]
regexp.(*Regexp).FindAllStringSubmatch.func1 590 -> 569  (-3.56%)
regexp.QuoteMeta 485 -> 469  (-3.30%)

encoding/base64 [cmd/compile]
encoding/base64.decodedLen 92 -> 90  (-2.17%)
encoding/base64.(*Encoding).DecodedLen 99 -> 97  (-2.02%)

encoding/hex
encoding/hex.Encode 138 -> 136  (-1.45%)
encoding/hex.(*decoder).Read 830 -> 824  (-0.72%)

crypto/des
crypto/des.initFeistelBox 235 -> 229  (-2.55%)
crypto/des.cryptBlock 549 -> 538  (-2.00%)

os [cmd/compile]
os.Chtimes 787 -> 774  (-1.65%)
os.Expand 1070 -> 1051  (-1.78%)

math/big
math/big.newFloat 238 -> 223  (-6.30%)
math/big.nat.mul 2138 -> 2122  (-0.75%)
math/big.karatsubaSqr 1372 -> 1369  (-0.22%)
math/big.(*Float).sqrtInverse 895 -> 878  (-1.90%)
math/big.basicSqr 1032 -> 1017  (-1.45%)

cmd/vendor/golang.org/x/sys/unix
cmd/vendor/golang.org/x/sys/unix.TimeToTimespec 72 -> 66  (-8.33%)

encoding/json
encoding/json.Indent 404 -> 403  (-0.25%)
encoding/json.MarshalIndent 303 -> 297  (-1.98%)

testing
testing.(*T).Deadline 84 -> 82  (-2.38%)
testing.(*M).Run 3545 -> 3525  (-0.56%)

archive/zip
archive/zip.headerFileInfo.ModTime 229 -> 223  (-2.62%)

encoding/gob
encoding/gob.(*encoderState).encodeInt 474 -> 469  (-1.05%)

crypto/elliptic
crypto/elliptic.Marshal 728 -> 714  (-1.92%)

debug/buildinfo
debug/buildinfo.readString 325 -> 315  (-3.08%)

image/png
image/png.(*decoder).readImagePass 10866 -> 10834  (-0.29%)

archive/tar
archive/tar.Header.allowedFormats.func3 1768 -> 1736  (-1.81%)
archive/tar.formatPAXTime 389 -> 358  (-7.97%)
archive/tar.(*Writer).writeGNUHeader 741 -> 727  (-1.89%)
archive/tar.readGNUSparseMap0x1 709 -> 695  (-1.97%)
archive/tar.(*Writer).templateV7Plus 915 -> 909  (-0.66%)

crypto/internal/cryptotest
crypto/internal/cryptotest.TestHash.func4 890 -> 879  (-1.24%)
crypto/internal/cryptotest.TestStream.func6.1 646 -> 645  (-0.15%)
crypto/internal/cryptotest.testCipher.func3 1300 -> 1289  (-0.85%)

internal/pkgbits
internal/pkgbits.(*Encoder).Int64 113 -> 103  (-8.85%)
internal/pkgbits.(*Encoder).rawVarint 74 -> 72  (-2.70%)

testing/quick
testing/quick.(*Config).getRand 316 -> 315  (-0.32%)

log/slog
log/slog.TimeValue 489 -> 479  (-2.04%)

runtime/pprof
runtime/pprof.(*profileBuilder).build 2341 -> 2322  (-0.81%)

internal/coverage/cfile
internal/coverage/cfile.(*emitState).openMetaFile 824 -> 822  (-0.24%)
internal/coverage/cfile.(*emitState).openCounterFile 904 -> 892  (-1.33%)

cmd/internal/objabi
cmd/internal/objabi.expandArgs 1177 -> 1169  (-0.68%)

crypto/ecdsa
crypto/ecdsa.pointFromAffine 1162 -> 1144  (-1.55%)

net
net.minNonzeroTime 313 -> 308  (-1.60%)
net.cgoLookupAddrPTR 812 -> 797  (-1.85%)
net.(*IPNet).String 851 -> 827  (-2.82%)
net.IP.AppendText 488 -> 471  (-3.48%)
net.IPMask.String 281 -> 270  (-3.91%)
net.partialDeadline 374 -> 366  (-2.14%)
net.hexString 249 -> 240  (-3.61%)
net.IP.String 454 -> 453  (-0.22%)

internal/fuzz
internal/fuzz.newPcgRand 240 -> 234  (-2.50%)

crypto/x509
crypto/x509.(*Certificate).isValid 2642 -> 2611  (-1.17%)

cmd/internal/obj/s390x
cmd/internal/obj/s390x.buildop 33676 -> 33644  (-0.10%)

encoding/hex [cmd/compile]
encoding/hex.(*decoder).Read 830 -> 824  (-0.72%)
encoding/hex.Encode 138 -> 136  (-1.45%)

cmd/internal/objabi [cmd/compile]
cmd/internal/objabi.expandArgs 1177 -> 1169  (-0.68%)

math/big [cmd/compile]
math/big.(*Float).sqrtInverse 895 -> 878  (-1.90%)
math/big.nat.mul 2138 -> 2122  (-0.75%)
math/big.karatsubaSqr 1372 -> 1369  (-0.22%)
math/big.basicSqr 1032 -> 1017  (-1.45%)
math/big.newFloat 238 -> 223  (-6.30%)

encoding/json [cmd/compile]
encoding/json.MarshalIndent 303 -> 297  (-1.98%)
encoding/json.Indent 404 -> 403  (-0.25%)

cmd/covdata
main.(*metaMerge).emitCounters 985 -> 973  (-1.22%)

runtime/pprof [cmd/compile]
runtime/pprof.(*profileBuilder).build 2341 -> 2322  (-0.81%)

cmd/compile/internal/syntax
cmd/compile/internal/syntax.(*source).fill 722 -> 703  (-2.63%)

cmd/dist
main.runInstall 19081 -> 19049  (-0.17%)

crypto/tls
crypto/tls.extractPadding 176 -> 175  (-0.57%)
slices.Clone[[]crypto/tls.SignatureScheme,crypto/tls.SignatureScheme] 253 -> 247  (-2.37%)
slices.Clone[[]uint16,uint16] 253 -> 247  (-2.37%)
slices.Clone[[]crypto/tls.CurveID,crypto/tls.CurveID] 253 -> 247  (-2.37%)
crypto/tls.(*Config).cipherSuites 335 -> 326  (-2.69%)
slices.DeleteFunc[go.shape.[]crypto/tls.CurveID,go.shape.uint16] 437 -> 434  (-0.69%)
crypto/tls.dial 1349 -> 1339  (-0.74%)
slices.DeleteFunc[go.shape.[]uint16,go.shape.uint16] 437 -> 434  (-0.69%)

internal/pkgbits [cmd/compile]
internal/pkgbits.(*Encoder).Int64 113 -> 103  (-8.85%)
internal/pkgbits.(*Encoder).rawVarint 74 -> 72  (-2.70%)

cmd/compile/internal/syntax [cmd/compile]
cmd/compile/internal/syntax.(*source).fill 722 -> 703  (-2.63%)

cmd/internal/obj/s390x [cmd/compile]
cmd/internal/obj/s390x.buildop 33676 -> 33644  (-0.10%)

cmd/go/internal/trace
cmd/go/internal/trace.Flow 910 -> 886  (-2.64%)
cmd/go/internal/trace.(*Span).Done 311 -> 304  (-2.25%)
cmd/go/internal/trace.StartSpan 620 -> 615  (-0.81%)

cmd/internal/script
cmd/internal/script.(*Engine).Execute.func2 534 -> 528  (-1.12%)

cmd/link/internal/loader
cmd/link/internal/loader.(*Loader).SetSymSect 344 -> 338  (-1.74%)

net/http
net/http.(*Transport).queueForIdleConn 1797 -> 1766  (-1.73%)
net/http.(*Transport).getConn 2149 -> 2131  (-0.84%)
net/http.(*http2ClientConn).tooIdleLocked 207 -> 197  (-4.83%)
net/http.(*http2responseWriter).SetWriteDeadline.func1 520 -> 508  (-2.31%)
net/http.(*Cookie).Valid 837 -> 818  (-2.27%)
net/http.(*http2responseWriter).SetReadDeadline 373 -> 357  (-4.29%)
net/http.checkIfRange 701 -> 690  (-1.57%)
net/http.(*http2SettingsFrame).Value 325 -> 298  (-8.31%)
net/http.(*http2SettingsFrame).HasDuplicates 777 -> 767  (-1.29%)
net/http.(*Server).Serve 1746 -> 1739  (-0.40%)
net/http.http2traceGotConn 569 -> 556  (-2.28%)

net/http/pprof
net/http/pprof.collectProfile 242 -> 239  (-1.24%)

cmd/compile/internal/coverage
cmd/compile/internal/coverage.metaHashAndLen 439 -> 438  (-0.23%)

cmd/vendor/golang.org/x/telemetry/internal/upload
cmd/vendor/golang.org/x/telemetry/internal/upload.(*uploader).findWork 4570 -> 4540  (-0.66%)
cmd/vendor/golang.org/x/telemetry/internal/upload.(*uploader).reports 3604 -> 3572  (-0.89%)

cmd/compile/internal/coverage [cmd/compile]
cmd/compile/internal/coverage.metaHashAndLen 439 -> 438  (-0.23%)

cmd/vendor/golang.org/x/text/language
cmd/vendor/golang.org/x/text/language.regionGroupDist 287 -> 284  (-1.05%)

cmd/go/internal/vcweb
cmd/go/internal/vcweb.(*Server).overview.func1 1045 -> 1041  (-0.38%)

cmd/go/internal/vcs
cmd/go/internal/vcs.expand 761 -> 741  (-2.63%)

cmd/compile/internal/inline/inlheur
slices.stableCmpFunc[go.shape.struct 2300 -> 2284  (-0.70%)

cmd/compile/internal/inline/inlheur [cmd/compile]
slices.stableCmpFunc[go.shape.struct 2300 -> 2284  (-0.70%)

cmd/go/internal/modfetch/codehost
cmd/go/internal/modfetch/codehost.bzrParseStat 2217 -> 2213  (-0.18%)

cmd/link/internal/ld
cmd/link/internal/ld.decodetypeStructFieldCount 157 -> 152  (-3.18%)
cmd/link/internal/ld.(*Link).address 12559 -> 12495  (-0.51%)
cmd/link/internal/ld.(*dodataState).allocateDataSections 18345 -> 18205  (-0.76%)
cmd/link/internal/ld.elfshreloc 618 -> 616  (-0.32%)
cmd/link/internal/ld.(*deadcodePass).decodetypeMethods 794 -> 779  (-1.89%)
cmd/link/internal/ld.(*dodataState).assignDsymsToSection 668 -> 663  (-0.75%)
cmd/link/internal/ld.relocSectFn 285 -> 284  (-0.35%)
cmd/link/internal/ld.decodetypeIfaceMethodCount 146 -> 144  (-1.37%)
cmd/link/internal/ld.decodetypeArrayLen 157 -> 152  (-3.18%)

cmd/link/internal/arm64
cmd/link/internal/arm64.gensymlate.func1 895 -> 888  (-0.78%)

cmd/go/internal/modload
cmd/go/internal/modload.queryProxy.func3 1029 -> 1012  (-1.65%)

cmd/go/internal/load
cmd/go/internal/load.(*Package).setBuildInfo 8453 -> 8447  (-0.07%)

cmd/go/internal/clean
cmd/go/internal/clean.runClean 2120 -> 2104  (-0.75%)

cmd/compile/internal/ssa
cmd/compile/internal/ssa.(*poset).aliasnodes 2010 -> 1978  (-1.59%)
cmd/compile/internal/ssa.rewriteValueARM64_OpARM64MOVHstoreidx2 730 -> 719  (-1.51%)
cmd/compile/internal/ssa.(*debugState).buildLocationLists 3326 -> 3294  (-0.96%)
cmd/compile/internal/ssa.rewriteValueAMD64_OpAMD64ADDLconst 3069 -> 2941  (-4.17%)
cmd/compile/internal/ssa.(*debugState).processValue 9756 -> 9724  (-0.33%)
cmd/compile/internal/ssa.rewriteValueAMD64_OpAMD64ADDQconst 3069 -> 2941  (-4.17%)
cmd/compile/internal/ssa.(*poset).mergeroot 1079 -> 1054  (-2.32%)

cmd/compile/internal/ssa [cmd/compile]
cmd/compile/internal/ssa.rewriteValueARM64_OpARM64MOVHstoreidx2 730 -> 719  (-1.51%)
cmd/compile/internal/ssa.(*poset).aliasnodes 2010 -> 1978  (-1.59%)
cmd/compile/internal/ssa.(*poset).mergeroot 1079 -> 1054  (-2.32%)
cmd/compile/internal/ssa.rewriteValueAMD64_OpAMD64ADDQconst 3069 -> 2941  (-4.17%)
cmd/compile/internal/ssa.rewriteValueAMD64_OpAMD64ADDLconst 3069 -> 2941  (-4.17%)

file                                                before   after    Δ       %
math/bits.s                                         2352     2354     +2      +0.085%
math/bits [cmd/compile].s                           2352     2354     +2      +0.085%
math.s                                              35675    35674    -1      -0.003%
math [cmd/compile].s                                35675    35674    -1      -0.003%
runtime.s                                           577251   577245   -6      -0.001%
runtime [cmd/compile].s                             642419   642438   +19     +0.003%
sort.s                                              37434    37435    +1      +0.003%
strconv.s                                           48391    48343    -48     -0.099%
sort [cmd/compile].s                                37434    37435    +1      +0.003%
bufio.s                                             21386    21418    +32     +0.150%
strconv [cmd/compile].s                             48391    48343    -48     -0.099%
image.s                                             34978    35022    +44     +0.126%
regexp/syntax.s                                     81719    81781    +62     +0.076%
time.s                                              94341    94184    -157    -0.166%
regexp.s                                            60411    60399    -12     -0.020%
bufio [cmd/compile].s                               21512    21544    +32     +0.149%
encoding/binary.s                                   34062    34087    +25     +0.073%
regexp/syntax [cmd/compile].s                       81719    81781    +62     +0.076%
encoding/base64.s                                   11907    11903    -4      -0.034%
time [cmd/compile].s                                94341    94184    -157    -0.166%
index/suffixarray.s                                 41633    41527    -106    -0.255%
os.s                                                101770   101738   -32     -0.031%
regexp [cmd/compile].s                              60411    60399    -12     -0.020%
encoding/binary [cmd/compile].s                     37173    37198    +25     +0.067%
encoding/base64 [cmd/compile].s                     11907    11903    -4      -0.034%
os/exec.s                                           23900    23907    +7      +0.029%
encoding/hex.s                                      6038     6030     -8      -0.132%
crypto/des.s                                        5073     5056     -17     -0.335%
os [cmd/compile].s                                  102030   101998   -32     -0.031%
vendor/golang.org/x/net/http2/hpack.s               22027    22033    +6      +0.027%
math/big.s                                          164808   164753   -55     -0.033%
cmd/vendor/golang.org/x/sys/unix.s                  121450   121444   -6      -0.005%
encoding/json.s                                     110294   110287   -7      -0.006%
testing.s                                           115303   115281   -22     -0.019%
archive/zip.s                                       65329    65325    -4      -0.006%
os/user.s                                           10078    10080    +2      +0.020%
encoding/gob.s                                      143788   143783   -5      -0.003%
crypto/elliptic.s                                   30686    30704    +18     +0.059%
go/doc/comment.s                                    49401    49433    +32     +0.065%
debug/buildinfo.s                                   9095     9085     -10     -0.110%
image/png.s                                         36113    36081    -32     -0.089%
archive/tar.s                                       71994    71897    -97     -0.135%
crypto/internal/cryptotest.s                        60872    60849    -23     -0.038%
internal/pkgbits.s                                  20441    20429    -12     -0.059%
testing/quick.s                                     8236     8235     -1      -0.012%
log/slog.s                                          77568    77558    -10     -0.013%
internal/trace/internal/oldtrace.s                  52885    52896    +11     +0.021%
runtime/pprof.s                                     123978   123969   -9      -0.007%
internal/coverage/cfile.s                           25198    25184    -14     -0.056%
cmd/internal/objabi.s                               19954    19946    -8      -0.040%
crypto/ecdsa.s                                      29159    29141    -18     -0.062%
log/slog/internal/benchmarks.s                      6694     6695     +1      +0.015%
net.s                                               299569   299503   -66     -0.022%
os/exec [cmd/compile].s                             23888    23895    +7      +0.029%
internal/trace.s                                    179226   179240   +14     +0.008%
internal/fuzz.s                                     86190    86191    +1      +0.001%
crypto/x509.s                                       177195   177164   -31     -0.017%
cmd/internal/obj/s390x.s                            121642   121610   -32     -0.026%
cmd/internal/obj/ppc64.s                            140118   140122   +4      +0.003%
encoding/hex [cmd/compile].s                        6149     6141     -8      -0.130%
cmd/internal/objabi [cmd/compile].s                 19954    19946    -8      -0.040%
cmd/internal/obj/arm64.s                            158523   158555   +32     +0.020%
go/doc/comment [cmd/compile].s                      49512    49544    +32     +0.065%
math/big [cmd/compile].s                            166394   166339   -55     -0.033%
encoding/json [cmd/compile].s                       110712   110705   -7      -0.006%
cmd/covdata.s                                       39699    39687    -12     -0.030%
runtime/pprof [cmd/compile].s                       125209   125200   -9      -0.007%
cmd/compile/internal/syntax.s                       181755   181736   -19     -0.010%
cmd/dist.s                                          177893   177861   -32     -0.018%
crypto/tls.s                                        389157   389113   -44     -0.011%
internal/pkgbits [cmd/compile].s                    41644    41632    -12     -0.029%
cmd/compile/internal/syntax [cmd/compile].s         196105   196086   -19     -0.010%
cmd/compile/internal/types.s                        71315    71345    +30     +0.042%
cmd/internal/obj/s390x [cmd/compile].s              121733   121701   -32     -0.026%
cmd/go/internal/trace.s                             4796     4760     -36     -0.751%
cmd/internal/obj/arm64 [cmd/compile].s              168120   168147   +27     +0.016%
cmd/internal/obj/ppc64 [cmd/compile].s              140219   140223   +4      +0.003%
cmd/internal/script.s                               83442    83436    -6      -0.007%
cmd/link/internal/loader.s                          93299    93294    -5      -0.005%
net/http.s                                          620639   620472   -167    -0.027%
net/http/pprof.s                                    35016    35013    -3      -0.009%
cmd/compile/internal/coverage.s                     6668     6667     -1      -0.015%
cmd/vendor/golang.org/x/telemetry/internal/upload.s 34210    34148    -62     -0.181%
cmd/compile/internal/coverage [cmd/compile].s       6664     6663     -1      -0.015%
cmd/vendor/golang.org/x/text/language.s             48077    48074    -3      -0.006%
cmd/go/internal/vcweb.s                             45193    45189    -4      -0.009%
cmd/go/internal/vcs.s                               44749    44729    -20     -0.045%
cmd/compile/internal/inline/inlheur.s               83758    83742    -16     -0.019%
cmd/compile/internal/inline/inlheur [cmd/compile].s 84773    84757    -16     -0.019%
cmd/go/internal/modfetch/codehost.s                 89098    89094    -4      -0.004%
cmd/trace.s                                         257550   257564   +14     +0.005%
cmd/link/internal/ld.s                              641945   641706   -239    -0.037%
cmd/link/internal/arm64.s                           34805    34798    -7      -0.020%
cmd/go/internal/modload.s                           328971   328954   -17     -0.005%
cmd/go/internal/load.s                              178877   178871   -6      -0.003%
cmd/go/internal/clean.s                             11006    10990    -16     -0.145%
cmd/compile/internal/ssa.s                          3552843  3553347  +504    +0.014%
cmd/compile/internal/ssa [cmd/compile].s            3752511  3753123  +612    +0.016%
total                                               36179015 36178687 -328    -0.001%

Change-Id: I251c2898ccf3c9931d162d87dabbd49cf4ec73a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/641757
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoruntime/cgo: clarify that C code must not retain pointer
Ian Lance Taylor [Thu, 6 Feb 2025 01:22:43 +0000 (17:22 -0800)]
runtime/cgo: clarify that C code must not retain pointer

For #71566

Change-Id: I6dc365dd799d7b506b4a55895f1736d3dfd4684b
Reviewed-on: https://go-review.googlesource.com/c/go/+/647095
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

6 months agotesting: use strings.SplitSeq and bytes.SplitSeq
apocelipes [Wed, 5 Feb 2025 12:19:12 +0000 (12:19 +0000)]
testing: use strings.SplitSeq and bytes.SplitSeq

To simplify the code. This is a follow-up for the CL 646216.

Change-Id: Ib09d1074a783482fb293527e9f1abeb3c02137c3
GitHub-Last-Rev: 2e7a6ad40cc22ea855e4d703ff39db9cc2c8a58e
GitHub-Pull-Request: golang/go#71568
Reviewed-on: https://go-review.googlesource.com/c/go/+/646755
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Salah (Globlost) <globlost@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
6 months agoRevert "cmd/go/internal/work: allow @ character in some -Wl, linker flags on darwin"
Roland Shoemaker [Wed, 29 Jan 2025 16:03:59 +0000 (08:03 -0800)]
Revert "cmd/go/internal/work: allow @ character in some -Wl, linker flags on darwin"

This reverts CL 638075 (commit e3cd55e9d293d519e622e788e902f372dc30338a).

This change introduced a security issue as @ flags are first resolved as
files by the darwin linker, before their meaning as flags, allowing the
flag filtering logic to be entirely bypassed.

Thanks to Juho Forsén for reporting this issue.

Fixes #71476
Fixes CVE-2025-22867

Change-Id: I3a4b4a6fc534de105d930b8ed5b9900bc94b0c4e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1900
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/646996
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agocmd/go: add '-skip' to list of cacheable test flags
Michael Matloob [Wed, 5 Feb 2025 20:27:29 +0000 (15:27 -0500)]
cmd/go: add '-skip' to list of cacheable test flags

-run is cacheable, so -skip should be cacheable too.

Fixes #70692

Change-Id: I16880189b0d3a963f8f08008fc7fedcdc6f11630
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/646997
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
6 months agointernal/trace: skip TestTraceCgoCallback on freebsd-amd64-race builders
Dmitri Shuralyov [Tue, 4 Feb 2025 03:50:29 +0000 (22:50 -0500)]
internal/trace: skip TestTraceCgoCallback on freebsd-amd64-race builders

For #71556.

Change-Id: I754f113bfdad244d0e978cf559bf45f2f4d7bf06
Reviewed-on: https://go-review.googlesource.com/c/go/+/646396
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
6 months agointernal/routebsd: fix typo in sockAddrLen identifer name
Dmitri Shuralyov [Wed, 5 Feb 2025 18:52:56 +0000 (13:52 -0500)]
internal/routebsd: fix typo in sockAddrLen identifer name

For #70528.

Change-Id: I0db75cb998aeb299676384fe59bf241db18ebc5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/646975
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoruntime: adjust comments for auxv getAuxv
Tobias Klauser [Tue, 4 Feb 2025 16:04:26 +0000 (17:04 +0100)]
runtime: adjust comments for auxv getAuxv

github.com/cilium/ebpf no longer accesses getAuxv using linkname but now
uses the golang.org/x/sys/unix.Auxv wrapper introduced in
go.dev/cl/644295.

Also adjust the list of users to include x/sys/unix.

Updates #67839
Updates #67401

Change-Id: Ieee266360b22cc0bc4be8f740e0302afd7dbd14f
Reviewed-on: https://go-review.googlesource.com/c/go/+/646535
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
6 months agocmd/go: skip bzr tests if 'bzr help' has non-zero exit code
Dmitri Shuralyov [Wed, 5 Feb 2025 00:54:25 +0000 (19:54 -0500)]
cmd/go: skip bzr tests if 'bzr help' has non-zero exit code

It appears to be quite easy to end up with a broken 'bzr' installation.
For example, if bzr was installed via a system-wide package manager and
intends to work with a system-wide Python installation, it may break if
another 'python3' binary is added to PATH.

If something as simple as 'bzr help' fails to exit with zero code,
consider it broken and skip tests that require a working bzr binary
just like if the 'bzr' binary isn't present in PATH at all.

This makes these tests more robust and capable of producing useful
signal in more environments. Separately from this, we'll want to
restore a working bzr installation on the linux-arm64 builders, but
at least there's still one on linux-amd64 builders.

For #71563.
Fixes #71504.

Change-Id: Ia147196f12b90a0731ebbfab63b5de308212ed65
Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64-longtest,gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/646715
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agointernal/routebsd: fix parsing network address of length zero
Ian Lance Taylor [Tue, 4 Feb 2025 23:11:42 +0000 (15:11 -0800)]
internal/routebsd: fix parsing network address of length zero

This applies CL 646555 from the net repository to this copy.

For #70528

Change-Id: Ib7e23accfa3f278392e7bdca6f8544b8f1395e7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/646676
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
6 months agocmd/compile: establish limits of bool to uint8 conversions
Jakub Ciolek [Tue, 14 Jan 2025 21:13:29 +0000 (22:13 +0100)]
cmd/compile: establish limits of bool to uint8 conversions

Improves bound check elimination for:

func arrayLargeEnough(b bool, a [2]int64) int64 {
    c := byte(0)
    if b {
        c = 1
    }

    // this bound check gets elided
    return a[c]
}

We also detect never true branches like:

func cCanOnlyBe0or1(b bool) byte {
    var c byte
    if b {
        c = 1
    }
    // this statement can never be true so we can elide it
    if c == 2 {
        c = 3
    }

    return c
}

Hits a few times:

crypto/internal/sysrand
crypto/internal/sysrand.Read 357 -> 349  (-2.24%)

testing
testing.(*F).Fuzz.func1.1 837 -> 828  (-1.08%)

image/png
image/png.(*Encoder).Encode 1735 -> 1733  (-0.12%)

vendor/golang.org/x/crypto/cryptobyte
vendor/golang.org/x/crypto/cryptobyte.(*Builder).callContinuation 187 -> 185  (-1.07%)

crypto/internal/sysrand [cmd/compile]
crypto/internal/sysrand.Read 357 -> 349  (-2.24%)

go/parser
go/parser.(*parser).parseType 463 -> 457  (-1.30%)
go/parser.(*parser).embeddedElem 633 -> 626  (-1.11%)
go/parser.(*parser).parseFuncDecl 917 -> 914  (-0.33%)
go/parser.(*parser).parseDotsType 393 -> 391  (-0.51%)
go/parser.(*parser).error 1061 -> 1054  (-0.66%)
go/parser.(*parser).parseTypeName 537 -> 532  (-0.93%)
go/parser.(*parser).parseParamDecl 1478 -> 1451  (-1.83%)
go/parser.(*parser).parseFuncTypeOrLit 498 -> 495  (-0.60%)
go/parser.(*parser).parseValue 375 -> 371  (-1.07%)
go/parser.(*parser).parseElementList 594 -> 593  (-0.17%)
go/parser.(*parser).parseResult 593 -> 583  (-1.69%)
go/parser.(*parser).parseElement 506 -> 504  (-0.40%)
go/parser.(*parser).parseImportSpec 1110 -> 1108  (-0.18%)
go/parser.(*parser).parseStructType 741 -> 735  (-0.81%)
go/parser.(*parser).parseTypeSpec 1054 -> 1048  (-0.57%)
go/parser.(*parser).parseIdentList 625 -> 623  (-0.32%)
go/parser.(*parser).parseOperand 1221 -> 1199  (-1.80%)
go/parser.(*parser).parseIndexOrSliceOrInstance 2713 -> 2694  (-0.70%)
go/parser.(*parser).parseSwitchStmt 1458 -> 1447  (-0.75%)
go/parser.(*parser).parseArrayFieldOrTypeInstance 1865 -> 1861  (-0.21%)
go/parser.(*parser).parseExpr 307 -> 305  (-0.65%)
go/parser.(*parser).parseSelector 427 -> 425  (-0.47%)
go/parser.(*parser).parseTypeInstance 1433 -> 1420  (-0.91%)
go/parser.(*parser).parseCaseClause 629 -> 626  (-0.48%)
go/parser.(*parser).parseParameterList 4212 -> 4189  (-0.55%)
go/parser.(*parser).parsePointerType 393 -> 391  (-0.51%)
go/parser.(*parser).parseFuncType 465 -> 463  (-0.43%)
go/parser.(*parser).parseTypeAssertion 559 -> 557  (-0.36%)
go/parser.(*parser).parseSimpleStmt 2443 -> 2388  (-2.25%)
go/parser.(*parser).parseCallOrConversion 1093 -> 1087  (-0.55%)
go/parser.(*parser).parseForStmt 2168 -> 2159  (-0.42%)
go/parser.(*parser).embeddedTerm 657 -> 649  (-1.22%)
go/parser.(*parser).parseCommClause 1509 -> 1501  (-0.53%)

cmd/internal/objfile
cmd/internal/objfile.(*goobjFile).symbols 5299 -> 5274  (-0.47%)

net
net.initConfVal 378 -> 374  (-1.06%)
net.(*conf).hostLookupOrder 269 -> 267  (-0.74%)
net.(*conf).addrLookupOrder 261 -> 255  (-2.30%)

cmd/internal/obj/loong64
cmd/internal/obj/loong64.(*ctxt0).oplook 1829 -> 1813  (-0.87%)

cmd/internal/obj/mips
cmd/internal/obj/mips.(*ctxt0).oplook 1428 -> 1400  (-1.96%)

go/types
go/types.(*typeWriter).signature 605 -> 601  (-0.66%)
go/types.(*Checker).instantiateSignature 1469 -> 1467  (-0.14%)

go/parser [cmd/compile]
go/parser.(*parser).parseSwitchStmt 1458 -> 1447  (-0.75%)
go/parser.(*parser).parseDotsType 393 -> 391  (-0.51%)
go/parser.(*parser).embeddedElem 633 -> 626  (-1.11%)
go/parser.(*parser).parseTypeAssertion 559 -> 557  (-0.36%)
go/parser.(*parser).parseCommClause 1509 -> 1501  (-0.53%)
go/parser.(*parser).parseCaseClause 629 -> 626  (-0.48%)
go/parser.(*parser).parseImportSpec 1110 -> 1108  (-0.18%)
go/parser.(*parser).parseTypeSpec 1054 -> 1048  (-0.57%)
go/parser.(*parser).parseElementList 594 -> 593  (-0.17%)
go/parser.(*parser).parseParamDecl 1478 -> 1451  (-1.83%)
go/parser.(*parser).parseType 463 -> 457  (-1.30%)
go/parser.(*parser).parseSimpleStmt 2443 -> 2388  (-2.25%)
go/parser.(*parser).parseIdentList 625 -> 623  (-0.32%)
go/parser.(*parser).parseTypeInstance 1433 -> 1420  (-0.91%)
go/parser.(*parser).parseResult 593 -> 583  (-1.69%)
go/parser.(*parser).parseValue 375 -> 371  (-1.07%)
go/parser.(*parser).parseFuncDecl 917 -> 914  (-0.33%)
go/parser.(*parser).error 1061 -> 1054  (-0.66%)
go/parser.(*parser).parseElement 506 -> 504  (-0.40%)
go/parser.(*parser).parseFuncType 465 -> 463  (-0.43%)
go/parser.(*parser).parsePointerType 393 -> 391  (-0.51%)
go/parser.(*parser).parseTypeName 537 -> 532  (-0.93%)
go/parser.(*parser).parseExpr 307 -> 305  (-0.65%)
go/parser.(*parser).parseFuncTypeOrLit 498 -> 495  (-0.60%)
go/parser.(*parser).parseStructType 741 -> 735  (-0.81%)
go/parser.(*parser).parseOperand 1221 -> 1199  (-1.80%)
go/parser.(*parser).parseIndexOrSliceOrInstance 2713 -> 2694  (-0.70%)
go/parser.(*parser).parseForStmt 2168 -> 2159  (-0.42%)
go/parser.(*parser).parseParameterList 4212 -> 4189  (-0.55%)
go/parser.(*parser).parseArrayFieldOrTypeInstance 1865 -> 1861  (-0.21%)
go/parser.(*parser).parseSelector 427 -> 425  (-0.47%)
go/parser.(*parser).parseCallOrConversion 1093 -> 1087  (-0.55%)
go/parser.(*parser).embeddedTerm 657 -> 649  (-1.22%)

crypto/tls
crypto/tls.(*Conn).clientHandshake 3430 -> 3421  (-0.26%)

cmd/internal/obj/mips [cmd/compile]
cmd/internal/obj/mips.(*ctxt0).oplook 1428 -> 1400  (-1.96%)

cmd/internal/obj/loong64 [cmd/compile]
cmd/internal/obj/loong64.(*ctxt0).oplook 1829 -> 1813  (-0.87%)

cmd/compile/internal/types2
cmd/compile/internal/types2.(*typeWriter).signature 605 -> 601  (-0.66%)
cmd/compile/internal/types2.(*Checker).infer 10646 -> 10614  (-0.30%)
cmd/compile/internal/types2.(*Checker).instantiateSignature 1567 -> 1561  (-0.38%)

cmd/compile/internal/types2 [cmd/compile]
cmd/compile/internal/types2.(*Checker).instantiateSignature 1567 -> 1561  (-0.38%)
cmd/compile/internal/types2.(*typeWriter).signature 605 -> 601  (-0.66%)
cmd/compile/internal/types2.(*Checker).infer 10718 -> 10654  (-0.60%)

cmd/vendor/golang.org/x/arch/s390x/s390xasm
cmd/vendor/golang.org/x/arch/s390x/s390xasm.GoSyntax 36778 -> 36682  (-0.26%)

net/http
net/http.(*Client).do 4202 -> 4170  (-0.76%)
net/http.(*http2clientStream).writeRequest 3692 -> 3686  (-0.16%)

cmd/vendor/github.com/ianlancetaylor/demangle
cmd/vendor/github.com/ianlancetaylor/demangle.(*rustState).genericArgs 466 -> 463  (-0.64%)

cmd/compile/internal/devirtualize
cmd/compile/internal/devirtualize.ProfileGuided.func1 1364 -> 1357  (-0.51%)

cmd/compile/internal/inline/interleaved
cmd/compile/internal/inline/interleaved.DevirtualizeAndInlinePackage.func2 533 -> 526  (-1.31%)

cmd/compile/internal/devirtualize [cmd/compile]
cmd/compile/internal/devirtualize.ProfileGuided.func1 1343 -> 1332  (-0.82%)

cmd/compile/internal/inline/interleaved [cmd/compile]
cmd/compile/internal/inline/interleaved.DevirtualizeAndInlinePackage.func2 533 -> 526  (-1.31%)

cmd/link/internal/ld
cmd/link/internal/ld.mustLinkExternal 2739 -> 2674  (-2.37%)

cmd/compile/internal/ssa
cmd/compile/internal/ssa.(*poset).Ordered 391 -> 389  (-0.51%)
cmd/compile/internal/ssa.(*poset).Equal 318 -> 313  (-1.57%)
cmd/compile/internal/ssa.(*poset).Undo 1842 -> 1832  (-0.54%)
cmd/compile/internal/ssa.(*expandState).decomposeAsNecessary 4587 -> 4555  (-0.70%)
cmd/compile/internal/ssa.(*poset).OrderedOrEqual 390 -> 389  (-0.26%)
cmd/compile/internal/ssa.(*poset).NonEqual 613 -> 606  (-1.14%)

cmd/compile/internal/ssa [cmd/compile]
cmd/compile/internal/ssa.(*poset).OrderedOrEqual 368 -> 365  (-0.82%)
cmd/compile/internal/ssa.(*poset).Equal 318 -> 313  (-1.57%)
cmd/compile/internal/ssa.(*expandState).decomposeAsNecessary 4952 -> 4938  (-0.28%)
cmd/compile/internal/ssa.(*poset).NonEqual 613 -> 606  (-1.14%)
cmd/compile/internal/ssa.(*poset).SetEqual 2533 -> 2505  (-1.11%)
cmd/compile/internal/ssa.(*poset).SetNonEqual 785 -> 777  (-1.02%)
cmd/compile/internal/ssa.(*poset).Ordered 370 -> 366  (-1.08%)

cmd/compile/internal/gc [cmd/compile]
cmd/compile/internal/gc.Main.DevirtualizeAndInlinePackage.func2 492 -> 489  (-0.61%)

file                                                    before   after    Δ       %
crypto/internal/sysrand.s                               1553     1545     -8      -0.515%
internal/zstd.s                                         49179    49190    +11     +0.022%
testing.s                                               115197   115188   -9      -0.008%
image/png.s                                             36109    36107    -2      -0.006%
vendor/golang.org/x/crypto/cryptobyte.s                 30980    30978    -2      -0.006%
crypto/internal/sysrand [cmd/compile].s                 1553     1545     -8      -0.515%
go/parser.s                                             112638   112354   -284    -0.252%
cmd/internal/objfile.s                                  49994    49969    -25     -0.050%
net.s                                                   299558   299546   -12     -0.004%
cmd/internal/obj/loong64.s                              71651    71635    -16     -0.022%
cmd/internal/obj/mips.s                                 59681    59653    -28     -0.047%
go/types.s                                              558839   558833   -6      -0.001%
cmd/compile/internal/types.s                            71305    71306    +1      +0.001%
go/parser [cmd/compile].s                               112749   112465   -284    -0.252%
crypto/tls.s                                            388859   388850   -9      -0.002%
cmd/internal/obj/mips [cmd/compile].s                   59792    59764    -28     -0.047%
cmd/internal/obj/loong64 [cmd/compile].s                71762    71746    -16     -0.022%
cmd/compile/internal/types2.s                           540608   540566   -42     -0.008%
cmd/compile/internal/types2 [cmd/compile].s             577428   577354   -74     -0.013%
cmd/vendor/golang.org/x/arch/s390x/s390xasm.s           267664   267568   -96     -0.036%
net/http.s                                              620704   620666   -38     -0.006%
cmd/vendor/github.com/ianlancetaylor/demangle.s         299991   299988   -3      -0.001%
cmd/compile/internal/devirtualize.s                     21452    21445    -7      -0.033%
cmd/compile/internal/inline/interleaved.s               8358     8351     -7      -0.084%
cmd/compile/internal/devirtualize [cmd/compile].s       20994    20983    -11     -0.052%
cmd/compile/internal/inline/interleaved [cmd/compile].s 8328     8321     -7      -0.084%
cmd/link/internal/ld.s                                  641802   641737   -65     -0.010%
cmd/compile/internal/ssa.s                              3552939  3552957  +18     +0.001%
cmd/compile/internal/ssa [cmd/compile].s                3752191  3752197  +6      +0.000%
cmd/compile/internal/ssagen.s                           405780   405786   +6      +0.001%
cmd/compile/internal/ssagen [cmd/compile].s             434472   434496   +24     +0.006%
cmd/compile/internal/gc [cmd/compile].s                 38499    38496    -3      -0.008%
total                                                   36185267 36184243 -1024   -0.003%

Change-Id: I867222b0f907b29d32b2676e55c6b5789ec56511
Reviewed-on: https://go-review.googlesource.com/c/go/+/642716
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
6 months agocpu/internal: provide runtime detection of RISC-V extensions on Linux
Mark Ryan [Fri, 25 Aug 2023 09:22:02 +0000 (11:22 +0200)]
cpu/internal: provide runtime detection of RISC-V extensions on Linux

Add a RISCV64 variable to cpu/internal that indicates both the presence
of RISC-V extensions and performance information about the underlying
RISC-V cores.  The variable is only populated with non false values on
Linux.  The detection code relies on the riscv_hwprobe syscall
introduced in Linux 6.4.  The patch can detect RVV 1.0 and whether
the CPU supports fast misaligned accesses.  It can only detect RVV 1.0
on a 6.5 kernel or later (without backports).

Updates #61416

Change-Id: I2d8289345c885b699afff441d417cae38f6bdc54
Reviewed-on: https://go-review.googlesource.com/c/go/+/522995
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
6 months agocmd/go: add rva23u64 as a valid value for GORISCV64
Mark Ryan [Mon, 2 Dec 2024 14:47:25 +0000 (15:47 +0100)]
cmd/go: add rva23u64 as a valid value for GORISCV64

The RVA23 profile was ratified on the 21st of October 2024.

https://riscv.org/announcements/2024/10/risc-v-announces-ratification-of-the-rva23-profile-standard/

Now that it's ratified we can add rva23u64 as a valid value for the
GORISCV64 environment variable. This will allow the compiler and
assembler to generate instructions made mandatory by the new profile
without a runtime check.  Examples of such instructions include those
introduced by the Vector and Zicond extensions.

Setting GORISCV64=rva23u64 defines the riscv64.rva20u64,
riscv64.rva22u64 and riscv64.rva23u64 build tags, sets the internal
variable buildcfg.GORISCV64 to 23 and defines the macros
GORISCV64_rva23u64, hasV, hasZba, hasZbb, hasZbs, hasZfa, and
hasZicond for use in assembly language code.

Updates #61476

Change-Id: I7641c23084fa52891c9a18df58f4013cb6597d88
Reviewed-on: https://go-review.googlesource.com/c/go/+/633417
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
6 months agonet/rpc: move frozen notice to the start of the package doc
Ian Lance Taylor [Tue, 4 Feb 2025 18:33:38 +0000 (10:33 -0800)]
net/rpc: move frozen notice to the start of the package doc

For #71559

Change-Id: I68b9518a26cab75789d596839267abab7997bc2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/646575
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

6 months agoos: fix race condition in readdir by atomically initializing dirinfo
Amirhossein Akhlaghpour [Mon, 3 Feb 2025 05:56:31 +0000 (05:56 +0000)]
os: fix race condition in readdir by atomically initializing dirinfo

This change ensures that dirinfo in the File struct is initialized atomically,
avoiding redundant allocations when multiple goroutines access it concurrently.
Instead of creating separate buffers, we now use CompareAndSwap to guarantee
thread-safe initialization and reduce unnecessary memory usage.

Although this is not a strict race condition, the update enhances efficiency by
eliminating duplicate allocations and ensuring safer concurrent access.

Fixes #71496.

Change-Id: If08699a94afa05611cdf67e82a5957a8d8f9d5c8
GitHub-Last-Rev: 1e1f6191439cf3ad32f3ba54bba5a0185dd55b14
GitHub-Pull-Request: golang/go#71501
Reviewed-on: https://go-review.googlesource.com/c/go/+/645720
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
6 months agonet: use strings.SplitSeq and bytes.SplitSeq
apocelipes [Wed, 5 Feb 2025 00:37:18 +0000 (00:37 +0000)]
net: use strings.SplitSeq and bytes.SplitSeq

Replace `for _, s := range {strings, bytes}.Split(v, sep)` with
`for s := range {strings, bytes}.SplitSeq(v, sep)`, to simplify
the code and reduce some memory allocations.

Change-Id: Idead4de1e3928fc75cc5ba8caeff85542f1243d5
GitHub-Last-Rev: 5fb196a073e7583b23b1ebb446d6c067580ed63a
GitHub-Pull-Request: golang/go#71554
Reviewed-on: https://go-review.googlesource.com/c/go/+/646216
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agonet: ignore unnamed interfaces on DragonFly
Ian Lance Taylor [Tue, 4 Feb 2025 22:23:14 +0000 (14:23 -0800)]
net: ignore unnamed interfaces on DragonFly

On DragonFly it seems that we can see an unnamed interface,
but be unable to retrieve it. Skip unnamed interface cases.

For #71064

Change-Id: Ie9af74bd656d403ddc19cc5f14062cd8e0fa2571
Reviewed-on: https://go-review.googlesource.com/c/go/+/646675
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

6 months agoos: remove Process.mode field
Ian Lance Taylor [Mon, 23 Dec 2024 04:26:23 +0000 (20:26 -0800)]
os: remove Process.mode field

It's now redundant with checking whether the handle field is nil.

For #70907

Change-Id: I877f2a7c63d15ab5f8e3d2c9aa24776c2e3e2056
Reviewed-on: https://go-review.googlesource.com/c/go/+/638576
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

6 months agoos: separate Process.handle into a separate memory allocation
Ian Lance Taylor [Mon, 23 Dec 2024 04:20:17 +0000 (20:20 -0800)]
os: separate Process.handle into a separate memory allocation

This is a step toward using AddCleanup rather than SetFinalizer
to close process handles.

For #70907

Change-Id: I7fb37461dd67b27135eab46fbdae94f0058ace85
Reviewed-on: https://go-review.googlesource.com/c/go/+/638575
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
6 months agocmd/compile: do not treat OpLocalAddr as load in DSE
Youlin Feng [Mon, 18 Nov 2024 09:34:20 +0000 (17:34 +0800)]
cmd/compile: do not treat OpLocalAddr as load in DSE

Fixes #70409
Fixes #47107

Change-Id: I82a66c46f6b76c68e156b5d937273b0316975d44
Reviewed-on: https://go-review.googlesource.com/c/go/+/629016
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
6 months agocmd/go/internal/vcsweb/vcstest: skip bzr test if deps not found
Ian Lance Taylor [Tue, 4 Feb 2025 19:56:38 +0000 (11:56 -0800)]
cmd/go/internal/vcsweb/vcstest: skip bzr test if deps not found

The linux-arm64 trybots are consistently failing with

    vcstest_test.go:155: 2025/01/30 21:50:41 hello.txt:
        > handle bzr
        > env BZR_EMAIL='Russ Cox <rsc@google.com>'
        > env EMAIL='Russ Cox <rsc@google.com>'
        > bzr init-repo .
        [stderr]
        brz: ERROR: Couldn't import breezy and dependencies.
        Please check the directory containing breezy is on your PYTHONPATH.

        Error: PyErr { type: <class 'ModuleNotFoundError'>, value: ModuleNotFoundError("No module named 'breezy'"), traceback: None }

    vcstest_test.go:161: hello.txt:6: bzr init-repo .: exit status 1

This seems to be a problem with the builder.

For now, skip the test if we see that error message, just as we already
skip the test if the bzr executable is not found.

For #71504

Change-Id: If8b6d4dea02dc16198ba6067595dff3340a81299
Reviewed-on: https://go-review.googlesource.com/c/go/+/646635
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
6 months agocmd/compile: include liveness info in GOSSAFUNC output
David Chase [Wed, 8 Jan 2025 22:01:05 +0000 (17:01 -0500)]
cmd/compile: include liveness info in GOSSAFUNC output

For this function
```
func test(a, b int, c string, s []int, r [3]int, f ifn) {
in(a)
in(b)
sl(s)
ar(r)
fu(f)
}
```
this output
```
HASH live at entry to test: f s
HASH /Users/drchase/work/src/live/main.go
00000 (15) TEXT main.test(SB), ABIInternal
00001 (15) FUNCDATA $0, gclocals·vYpXgR4/KsH5nhFsqkHG1Q==(SB)
00002 (15) FUNCDATA $1, gclocals·Soq6RzO4SX8YA1O9euewoQ==(SB)
00003 (15) FUNCDATA $5, main.test.arginfo1(SB)
00004 (15) FUNCDATA $6, main.test.argliveinfo(SB)
b1 00005 (15) PCDATA $3, $1
v32 00006 (21) MOVD R6, main.s+72(RSP)
v27 00007 (21) MOVD R5, main.s+64(RSP)
v30 00008 (21) MOVD R4, main.s+56(RSP)
v7 00009 (21) MOVD R1, main.b+32(RSP)
v34 00010 (21) MOVD R7, main.f+80(RSP)
v34 00011 (21) PCDATA $3, $2
v15 00012 (+16) PCDATA $1, $0
HASH live at call to in: f s
v15 00013 (+16) CALL main.in(SB)
v3 00014 (+17) MOVD main.b+32(RSP), R0
HASH live at call to in: f s
v17 00015 (+17) CALL main.in(SB)
v8 00016 (+18) MOVD main.s+56(RSP), R0
v21 00017 (18) MOVD main.s+64(RSP), R1
v33 00018 (18) MOVD main.s+72(RSP), R2
v19 00019 (+18) PCDATA $1, $1
HASH live at call to sl: f
v19 00020 (+18) CALL main.sl(SB)
v29 00021 (+19) LDP main.r(RSP), (R1, R2)
v9 00022 (19) STP (R1, R2), 8(RSP)
v12 00023 (19) MOVD main.r+16(RSP), R1
v31 00024 (19) MOVD R1, 24(RSP)
HASH live at call to ar: f
v22 00025 (+19) CALL main.ar(SB)
v35 00026 (+20) MOVD main.f+80(RSP), R0
v24 00027 (+20) PCDATA $1, $2
HASH live at call to fu:
v24 00028 (+20) CALL main.fu(SB)
b1 00029 (21) RET
00030 (?) END
```

Where "HASH" is the git commit comment character I don't know how
to escape and this was easier than fighting with git.

Change-Id: I0691a3f7988db111d11d69388ace83641a841e57
Reviewed-on: https://go-review.googlesource.com/c/go/+/641360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 months agocmd/compile: remove reduntant Zero rule
Jakub Ciolek [Sun, 5 Jan 2025 10:31:11 +0000 (11:31 +0100)]
cmd/compile: remove reduntant Zero rule

These two rules produce the same output but have opposite
s%16 conditions. Consolidate them into a single rule.

Change-Id: I6daa0e7f7af4a4e59a3125b66b85f59e888586c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/640475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agocmd/compile: use isGenericIntConst() in prove
Jakub Ciolek [Tue, 14 Jan 2025 20:29:50 +0000 (21:29 +0100)]
cmd/compile: use isGenericIntConst() in prove

Use the existing Value method to make it a bit shorter.

Change-Id: I47c4328b5241ab48b3490a04a3d93d4428f7b88c
Reviewed-on: https://go-review.googlesource.com/c/go/+/642735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
6 months agocmd/internal/sys: allow unaligned loads on big-endian ppc64
Keith Randall [Fri, 22 Nov 2024 23:24:54 +0000 (15:24 -0800)]
cmd/internal/sys: allow unaligned loads on big-endian ppc64

According to https://go.dev/wiki/MinimumRequirements, we've required
power8 since Go 1.9.

Before that, we supported power5 which couldn't do unaligned loads.
But power8 should be able to (it does for ppc64le).

In fact, I think we already support unaligned loads in some cases,
for instance cmd/compile/internal/ssa/config.go lists big-endian ppc64
as having unaligned loads.

Change-Id: I4a75f09d4b5199a889e0e8db0b3b7a1fa23145f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/631318
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Jayanth Krishnamurthy <jayanth.krishnamurthy@ibm.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
6 months agocmd/compile: prefer hv2 <= 127 over hv2 < 128
Jakub Ciolek [Mon, 13 Jan 2025 20:35:04 +0000 (21:35 +0100)]
cmd/compile: prefer hv2 <= 127 over hv2 < 128

This is shorter to encode on AMD64/x86. Shrinks a few functions and doesn't
seem to cause any regressions. No size impact on other archs.

Covers a bit more than CL 639935.

compilecmp linux/amd64:

unicode/utf8
unicode/utf8.RuneCountInString changed
unicode/utf8.RuneCount changed

unicode/utf8 [cmd/compile]
unicode/utf8.RuneCount changed
unicode/utf8.RuneCountInString changed

runtime
runtime.countrunes changed
runtime.stringtoslicerune 413 -> 379  (-8.23%)

runtime [cmd/compile]
runtime.countrunes changed
runtime.stringtoslicerune 413 -> 379  (-8.23%)

bytes
bytes.containsRune 143 -> 139  (-2.80%)
bytes.IndexAny changed
bytes.Runes 462 -> 455  (-1.52%)
bytes.trimLeftUnicode changed
bytes.trimRightUnicode 325 -> 316  (-2.77%)
bytes.LastIndexAny 1261 -> 1256  (-0.40%)
bytes.Count 524 -> 520  (-0.76%)

strings
strings.Map 1241 -> 1230  (-0.89%)
strings.TrimFunc 261 -> 255  (-2.30%)
strings.Count changed
strings.IndexRune changed
strings.TrimLeftFunc 249 -> 241  (-3.21%)
strings.explode 462 -> 441  (-4.55%)
strings.IndexAny changed
strings.ToValidUTF8 changed
strings.FieldsFunc 744 -> 741  (-0.40%)
strings.EqualFold 638 -> 625  (-2.04%)
strings.IndexFunc 185 -> 179  (-3.24%)
strings.ContainsFunc 189 -> 185  (-2.12%)
strings.indexFunc 213 -> 209  (-1.88%)

go/build/constraint
go/build/constraint.(*exprParser).lex changed
go/build/constraint.isValidTag changed

regexp/syntax
regexp/syntax.isValidCaptureName 180 -> 174  (-3.33%)
regexp/syntax.literalRegexp changed
regexp/syntax.(*parser).parsePerlFlags changed
regexp/syntax.parse changed

time
time.tzsetName 471 -> 455  (-3.40%)
time.tzsetRule 2476 -> 2444  (-1.29%)
time.tzsetNum 389 -> 365  (-6.17%)
time.quote 1239 -> 1221  (-1.45%)
time.tzsetOffset 1332 -> 1317  (-1.13%)

io/fs
io/fs.FileMode.String changed

reflect
reflect.Value.Seq2.func4 changed
reflect.Value.Seq.func4 changed
reflect.isValidFieldName 265 -> 261  (-1.51%)

bytes [cmd/compile]
bytes.Runes 462 -> 455  (-1.52%)
bytes.trimLeftUnicode changed
bytes.LastIndexAny 1261 -> 1256  (-0.40%)
bytes.IndexAny changed
bytes.trimRightUnicode 325 -> 316  (-2.77%)
bytes.Count 524 -> 520  (-0.76%)
bytes.containsRune 143 -> 139  (-2.80%)

strings [cmd/compile]
strings.indexFunc 213 -> 209  (-1.88%)
strings.IndexAny changed
strings.FieldsFunc 744 -> 741  (-0.40%)
strings.IndexRune changed
strings.Count changed
strings.IndexFunc 185 -> 179  (-3.24%)
strings.Map 1241 -> 1230  (-0.89%)
strings.TrimFunc 261 -> 255  (-2.30%)
strings.ToValidUTF8 changed
strings.explode 462 -> 441  (-4.55%)
strings.EqualFold 638 -> 625  (-2.04%)
strings.ContainsFunc 189 -> 185  (-2.12%)
strings.TrimLeftFunc 249 -> 241  (-3.21%)

go/build/constraint [cmd/compile]
go/build/constraint.(*exprParser).lex changed
go/build/constraint.isValidTag changed

regexp/syntax [cmd/compile]
regexp/syntax.literalRegexp changed
regexp/syntax.parse changed
regexp/syntax.(*parser).parsePerlFlags changed
regexp/syntax.isValidCaptureName 180 -> 174  (-3.33%)

fmt
fmt.(*ss).scanOne changed
fmt.(*ss).scanUint changed
fmt.(*ss).scanInt changed
fmt.(*fmt).pad changed
fmt.(*ss).getBase 447 -> 435  (-2.68%)
fmt.(*fmt).fmtS 217 -> 211  (-2.76%)
fmt.(*ss).consume changed
fmt.(*fmt).fmtQ 494 -> 485  (-1.82%)
fmt.(*fmt).truncateString changed
fmt.(*ss).scanComplex changed
fmt.(*ss).okVerb 410 -> 409  (-0.24%)
fmt.(*ss).convertString 447 -> 436  (-2.46%)
fmt.(*ss).peek changed
fmt.FormatString 650 -> 625  (-3.85%)
fmt.(*fmt).padString changed
fmt.(*ss).convertFloat changed
fmt.(*ss).scanBool changed
fmt.indexRune changed

time [cmd/compile]
time.tzsetNum 389 -> 365  (-6.17%)
time.tzsetOffset 1332 -> 1317  (-1.13%)
time.tzsetName 471 -> 455  (-3.40%)
time.tzsetRule 2476 -> 2444  (-1.29%)
time.quote 1239 -> 1221  (-1.45%)

net/url
net/url.validOptionalPort 189 -> 186  (-1.59%)
net/url.validUserinfo 229 -> 204  (-10.92%)
net/url.parseAuthority 972 -> 948  (-2.47%)
net/url.parseHost 1372 -> 1371  (-0.07%)
net/url.splitHostPort 584 -> 581  (-0.51%)

reflect [cmd/compile]
reflect.isValidFieldName 265 -> 261  (-1.51%)
reflect.Value.Seq2.func4 changed
reflect.Value.Seq.func4 changed

compress/gzip
compress/gzip.(*Writer).writeString changed

encoding/json
encoding/json.isValidTag 313 -> 308  (-1.60%)

testing
testing.rewrite changed
testing.(*B).ReportMetric changed

mime
mime.consumeValue 1012 -> 997  (-1.48%)
mime.isToken 180 -> 172  (-4.44%)
mime.checkMediaTypeDisposition changed
mime.FormatMediaType 6375 -> 6343  (-0.50%)
mime.consumeToken changed
mime.needsEncoding 137 -> 135  (-1.46%)
mime.WordEncoder.Encode 216 -> 210  (-2.78%)
mime.consumeMediaParam 1620 -> 1605  (-0.93%)
mime.hasNonWhitespace 142 -> 139  (-2.11%)
mime.(*WordDecoder).DecodeHeader 2643 -> 2630  (-0.49%)
mime.ParseMediaType 3037 -> 3035  (-0.07%)

go/token
go/token.IsIdentifier changed

encoding/asn1
encoding/asn1.makeField changed

text/tabwriter
text/tabwriter.(*Writer).Write 3465 -> 3454  (-0.32%)
text/tabwriter.(*Writer).updateWidth changed
text/tabwriter.(*Writer).endEscape 335 -> 327  (-2.39%)

internal/buildcfg
internal/buildcfg.goriscv64 changed

go/doc/comment
go/doc/comment.wrap 5496 -> 5489  (-0.13%)
go/doc/comment.(*Printer).Text 1033 -> 1030  (-0.29%)
go/doc/comment.validImportPath 661 -> 648  (-1.97%)
go/doc/comment.(*Heading).DefaultID changed
go/doc/comment.(*textPrinter).text 1070 -> 1069  (-0.09%)

archive/tar
archive/tar.splitUSTARPath changed
archive/tar.(*Writer).writeRawFile changed
archive/tar.(*Reader).readHeader 2416 -> 2415  (-0.04%)
archive/tar.isASCII 136 -> 133  (-2.21%)
archive/tar.Header.allowedFormats.func1 changed
archive/tar.toASCII 415 -> 393  (-5.30%)
archive/tar.(*Writer).writePAXHeader.func1 645 -> 627  (-2.79%)

crypto/x509/pkix
crypto/x509/pkix.RDNSequence.String 1502 -> 1486  (-1.07%)

go/constant
go/constant.(*stringVal).String changed

vendor/golang.org/x/net/idna
vendor/golang.org/x/net/idna.decode changed
vendor/golang.org/x/net/idna.encode 2000 -> 1968  (-1.60%)

internal/trace/raw
internal/trace/raw.readArgs 783 -> 781  (-0.26%)
internal/trace/raw.NewTextReader 1158 -> 1157  (-0.09%)
internal/trace/raw.readToken 542 -> 532  (-1.85%)

cmd/internal/objabi
cmd/internal/objabi.DecodeArg changed

cmd/internal/quoted
cmd/internal/quoted.Join changed

cmd/internal/pkgpath
cmd/internal/pkgpath.toSymbolV3 changed
cmd/internal/pkgpath.toSymbolV2 changed

testing/fstest
testing/fstest.(*fsTester).checkGlob changed

text/template
text/template.JSEscapeString changed
text/template.goodName changed

io/fs [cmd/compile]
io/fs.FileMode.String changed

go/printer
go/printer.sanitizeImportPath 470 -> 463  (-1.49%)
go/printer.(*printer).isOneLineFieldList changed
go/printer.identListSize 261 -> 254  (-2.68%)

go/doc
go/doc.assumedPackageName changed
go/doc.firstSentence changed

net
net.parseCriteria.func1 changed
net.hasUpperCase 181 -> 180  (-0.55%)
net.parsePort changed
net.lookupStaticHost changed

html/template
html/template.htmlNameFilter 251 -> 249  (-0.80%)

vendor/golang.org/x/net/http/httpguts
vendor/golang.org/x/net/http/httpguts.tokenEqual changed
vendor/golang.org/x/net/http/httpguts.headerValueContainsToken 971 -> 965  (-0.62%)

mime/multipart
mime/multipart.(*Writer).SetBoundary 510 -> 505  (-0.98%)

go/build
go/build.splitQuoted 1157 -> 1148  (-0.78%)
go/build.parseGoEmbed changed
go/build.isValidImport 203 -> 197  (-2.96%)

net/mail
net/mail.(*addrParser).parseAddress changed
net/mail.quoteString changed
net/mail.(*Address).String changed

crypto/x509
crypto/x509.(*Certificate).VerifyHostname 1020 -> 1018  (-0.20%)
crypto/x509.toLowerCaseASCII 223 -> 215  (-3.59%)
crypto/x509.matchHostnames changed
crypto/x509.validHostname 506 -> 505  (-0.20%)
crypto/x509.isIA5String 197 -> 186  (-5.58%)
crypto/x509.parseNameConstraintsExtension.func1 changed
crypto/x509.matchExactly changed
crypto/x509.parseSANExtension.func1 1996 -> 1982  (-0.70%)
crypto/x509.marshalSANs 3071 -> 3051  (-0.65%)
crypto/x509.domainToReverseLabels 820 -> 805  (-1.83%)
crypto/x509.buildCertExtensions.func2 changed
crypto/x509.(*OID).unmarshalOIDText 1359 -> 1355  (-0.29%)
crypto/x509.parseASN1String 1350 -> 1334  (-1.19%)

cmd/cgo
main.checkImportSymName changed
main.splitQuoted 1157 -> 1148  (-0.78%)

fmt [cmd/compile]
fmt.(*fmt).fmtQ 494 -> 485  (-1.82%)
fmt.(*ss).scanComplex changed
fmt.(*fmt).truncateString changed
fmt.(*fmt).pad changed
fmt.(*ss).getBase 447 -> 435  (-2.68%)
fmt.(*ss).convertFloat changed
fmt.(*fmt).padString changed
fmt.(*fmt).fmtS 217 -> 211  (-2.76%)
fmt.(*ss).scanInt changed
fmt.indexRune changed
fmt.(*ss).okVerb 410 -> 409  (-0.24%)
fmt.FormatString 650 -> 625  (-3.85%)
fmt.(*ss).consume changed
fmt.(*ss).scanUint changed
fmt.(*ss).scanOne changed
fmt.(*ss).peek changed
fmt.(*ss).convertString 447 -> 436  (-2.46%)
fmt.(*ss).scanBool changed

internal/buildcfg [cmd/compile]
internal/buildcfg.goriscv64 changed

cmd/compile/internal/base
cmd/compile/internal/base.lines.write 1451 -> 1450  (-0.07%)
cmd/compile/internal/base.isnumber 165 -> 154  (-6.67%)

go/token [cmd/compile]
go/token.IsIdentifier changed

net/url [cmd/compile]
net/url.validOptionalPort 189 -> 186  (-1.59%)
net/url.splitHostPort 584 -> 581  (-0.51%)
net/url.parseAuthority 972 -> 948  (-2.47%)
net/url.validUserinfo 229 -> 204  (-10.92%)
net/url.parseHost 1372 -> 1371  (-0.07%)

cmd/internal/objabi [cmd/compile]
cmd/internal/objabi.DecodeArg changed

text/tabwriter [cmd/compile]
text/tabwriter.(*Writer).endEscape 335 -> 327  (-2.39%)
text/tabwriter.(*Writer).updateWidth changed
text/tabwriter.(*Writer).Write 3465 -> 3454  (-0.32%)

go/doc/comment [cmd/compile]
go/doc/comment.validImportPath 661 -> 648  (-1.97%)
go/doc/comment.wrap 5496 -> 5489  (-0.13%)
go/doc/comment.(*Printer).Text 1033 -> 1030  (-0.29%)
go/doc/comment.(*textPrinter).text 1070 -> 1069  (-0.09%)
go/doc/comment.(*Heading).DefaultID changed

compress/gzip [cmd/compile]
compress/gzip.(*Writer).writeString changed

encoding/json [cmd/compile]
encoding/json.isValidTag 313 -> 308  (-1.60%)

cmd/doc
main.match 549 -> 542  (-1.28%)

go/types
go/types.validatedImportPath changed
go/types.(*Checker).lookupError 3109 -> 3082  (-0.87%)
go/types.stripAnnotations 233 -> 229  (-1.72%)
go/types.tail 153 -> 148  (-3.27%)
go/types.isValidName 345 -> 330  (-4.35%)

cmd/compile/internal/syntax
cmd/compile/internal/syntax.(*scanner).lineComment 655 -> 634  (-3.21%)
cmd/compile/internal/syntax.(*scanner).fullComment 527 -> 517  (-1.90%)

crypto/tls
crypto/tls.validDNSName changed

go/constant [cmd/compile]
go/constant.(*stringVal).String changed

cmd/go/internal/str
cmd/go/internal/str.ToFold 293 -> 278  (-5.12%)
cmd/go/internal/str.QuoteGlob changed

go/doc [cmd/compile]
go/doc.firstSentence changed
go/doc.assumedPackageName changed

cmd/compile/internal/base [cmd/compile]
cmd/compile/internal/base.lines.write 1451 -> 1450  (-0.07%)
cmd/compile/internal/base.isnumber 165 -> 154  (-6.67%)

cmd/compile/internal/syntax [cmd/compile]
cmd/compile/internal/syntax.(*scanner).fullComment 527 -> 517  (-1.90%)
cmd/compile/internal/syntax.(*scanner).lineComment changed

cmd/vendor/golang.org/x/mod/module
cmd/vendor/golang.org/x/mod/module.unescapeString 500 -> 487  (-2.60%)
cmd/vendor/golang.org/x/mod/module.escapeString 538 -> 519  (-3.53%)
cmd/vendor/golang.org/x/mod/module.checkPath changed
cmd/vendor/golang.org/x/mod/module.checkElem changed
cmd/vendor/golang.org/x/mod/module.CheckPath changed

cmd/vendor/golang.org/x/mod/sumdb/note
cmd/vendor/golang.org/x/mod/sumdb/note.isValidName 246 -> 244  (-0.81%)

cmd/go/internal/base
cmd/go/internal/base.validToolName 150 -> 142  (-5.33%)
cmd/go/internal/base.ToolPath 488 -> 474  (-2.87%)

cmd/go/internal/imports
cmd/go/internal/imports.matchTag changed

go/build [cmd/compile]
go/build.isValidImport 203 -> 197  (-2.96%)
go/build.splitQuoted 1157 -> 1148  (-0.78%)
go/build.parseGoEmbed changed

cmd/vendor/golang.org/x/mod/modfile
cmd/vendor/golang.org/x/mod/modfile.Position.add 421 -> 412  (-2.14%)
cmd/vendor/golang.org/x/mod/modfile.MustQuote 380 -> 372  (-2.11%)

cmd/vendor/golang.org/x/mod/zip
cmd/vendor/golang.org/x/mod/zip.strToFold changed

cmd/link/internal/benchmark
cmd/link/internal/benchmark.makeBenchString 476 -> 453  (-4.83%)

cmd/internal/script
cmd/internal/script.wrapLine 773 -> 766  (-0.91%)

cmd/compile/internal/ir
cmd/compile/internal/ir.splitPkg changed
cmd/compile/internal/ir.splitType changed
cmd/compile/internal/ir.LookupMethodSelector changed

cmd/go/internal/modindex
cmd/go/internal/modindex.parseGoEmbed changed
cmd/go/internal/modindex.splitQuoted 1157 -> 1148  (-0.78%)

cmd/pack
main.setOp 325 -> 308  (-5.23%)

cmd/vendor/golang.org/x/term
cmd/vendor/golang.org/x/term.(*Terminal).handleKey changed

cmd/compile/internal/types2
cmd/compile/internal/types2.validatedImportPath changed
cmd/compile/internal/types2.tail 153 -> 148  (-3.27%)
cmd/compile/internal/types2.(*Checker).lookupError 3717 -> 3690  (-0.73%)
cmd/compile/internal/types2.isValidName 345 -> 330  (-4.35%)
cmd/compile/internal/types2.stripAnnotations 233 -> 229  (-1.72%)

net/http
net/http.NewRequestWithContext 2251 -> 2245  (-0.27%)
net/http.isValidWildcardName 357 -> 351  (-1.68%)
net/http.ParseCookie 1100 -> 1099  (-0.09%)
net/http.ParseSetCookie changed
net/http.readCookies changed
net/http.(*http2Framer).readMetaFrame.func1 changed
net/http.isCookieNameValid changed
net/http.(*Cookie).String changed
net/http.(*Cookie).Valid changed
net/http.validMethod changed
net/http.parsePattern 4343 -> 4330  (-0.30%)
net/http.http2validWireHeaderFieldName changed
net/http.http2encodeHeaders changed
net/http.(*Transport).roundTrip changed

cmd/compile/internal/types2 [cmd/compile]
cmd/compile/internal/types2.validatedImportPath changed
cmd/compile/internal/types2.stripAnnotations 233 -> 229  (-1.72%)
cmd/compile/internal/types2.tail 153 -> 148  (-3.27%)
cmd/compile/internal/types2.(*Checker).lookupError 3717 -> 3690  (-0.73%)
cmd/compile/internal/types2.isValidName 345 -> 330  (-4.35%)

cmd/compile/internal/ir [cmd/compile]
cmd/compile/internal/ir.LookupMethodSelector changed
cmd/compile/internal/ir.splitType changed
cmd/compile/internal/ir.splitPkg changed

cmd/compile/internal/typecheck
cmd/compile/internal/typecheck.stringtoruneslit changed

net/http/cookiejar
net/http/cookiejar.encode 1944 -> 1936  (-0.41%)

expvar
expvar.appendJSONQuote changed

cmd/go/internal/web
cmd/go/internal/web.(*Response).formatErrorDetail 1552 -> 1529  (-1.48%)

cmd/vendor/golang.org/x/text/internal/language
cmd/vendor/golang.org/x/text/internal/language.Parse 1102 -> 1099  (-0.27%)

cmd/vendor/golang.org/x/tools/go/analysis
cmd/vendor/golang.org/x/tools/go/analysis.validIdent 351 -> 346  (-1.42%)

cmd/compile/internal/typecheck [cmd/compile]
cmd/compile/internal/typecheck.stringtoruneslit changed

cmd/vendor/github.com/google/pprof/internal/report
cmd/vendor/github.com/google/pprof/internal/report.rightPad 377 -> 365  (-3.18%)
cmd/vendor/github.com/google/pprof/internal/report.indentation 169 -> 165  (-2.37%)
cmd/vendor/github.com/google/pprof/internal/report.makeWebListLine changed

cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag
cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag.(*checker).plusBuildLine changed

cmd/vendor/golang.org/x/tools/go/analysis/passes/directive
cmd/vendor/golang.org/x/tools/go/analysis/passes/directive.(*checker).comment changed

cmd/vendor/rsc.io/markdown
cmd/vendor/rsc.io/markdown.(*CodeBlock).PrintHTML changed
cmd/vendor/rsc.io/markdown.(*Code).printMarkdown changed
cmd/vendor/rsc.io/markdown.newATXHeading changed
cmd/vendor/rsc.io/markdown.longestSequence 249 -> 237  (-4.82%)
cmd/vendor/rsc.io/markdown.newFence changed

cmd/link/internal/ld
cmd/link/internal/ld.methodref.isExported changed

cmd/go/internal/modload
cmd/go/internal/modload.ShortMessage changed

cmd/go/internal/work
cmd/go/internal/work.encodeArg changed

cmd/compile/internal/walk
cmd/compile/internal/walk.rangeAssign2 changed
cmd/compile/internal/walk.arrayRangeClear changed
cmd/compile/internal/walk.rangeAssign changed
cmd/compile/internal/walk.mapClear changed
cmd/compile/internal/walk.arrayClear changed
cmd/compile/internal/walk.isMapClear changed
cmd/compile/internal/walk.walkRange 15218 -> 15538  (+2.10%)
cmd/compile/internal/walk.mapRangeClear changed
cmd/compile/internal/walk.mapRangeClear.func1 changed
cmd/compile/internal/walk.rangeConvert changed

cmd/compile/internal/noder
cmd/compile/internal/noder.checkImportPath changed
cmd/compile/internal/noder.pragmaFields changed
cmd/compile/internal/noder.parseGoEmbed 1309 -> 1300  (-0.69%)

cmd/compile/internal/walk [cmd/compile]
cmd/compile/internal/walk.mapRangeClear changed
cmd/compile/internal/walk.rangeAssign2 changed
cmd/compile/internal/walk.arrayClear changed
cmd/compile/internal/walk.arrayRangeClear changed
cmd/compile/internal/walk.walkRange 14789 -> 15109  (+2.16%)
cmd/compile/internal/walk.mapRangeClear.func1 changed
cmd/compile/internal/walk.rangeConvert changed
cmd/compile/internal/walk.mapClear changed
cmd/compile/internal/walk.isMapClear changed
cmd/compile/internal/walk.rangeAssign changed

cmd/compile/internal/noder [cmd/compile]
cmd/compile/internal/noder.pragmaFields changed
cmd/compile/internal/noder.parseGoEmbed 1309 -> 1300  (-0.69%)
cmd/compile/internal/noder.checkImportPath changed

file                                                 before   after    Δ       %
runtime.s                                            577251   577217   -34     -0.006%
runtime [cmd/compile].s                              642419   642385   -34     -0.005%
bytes.s                                              36806    36777    -29     -0.079%
strings.s                                            44176    44100    -76     -0.172%
regexp/syntax.s                                      81719    81713    -6      -0.007%
time.s                                               94341    94236    -105    -0.111%
reflect.s                                            180291   180287   -4      -0.002%
bytes [cmd/compile].s                                38181    38152    -29     -0.076%
strings [cmd/compile].s                              44192    44116    -76     -0.172%
regexp/syntax [cmd/compile].s                        81719    81713    -6      -0.007%
fmt.s                                                75019    74955    -64     -0.085%
time [cmd/compile].s                                 94341    94236    -105    -0.111%
net/url.s                                            37111    37055    -56     -0.151%
reflect [cmd/compile].s                              180340   180336   -4      -0.002%
encoding/json.s                                      110294   110289   -5      -0.005%
mime.s                                               47009    46913    -96     -0.204%
text/tabwriter.s                                     9538     9519     -19     -0.199%
go/doc/comment.s                                     49401    49377    -24     -0.049%
archive/tar.s                                        71994    71950    -44     -0.061%
crypto/x509/pkix.s                                   8493     8477     -16     -0.188%
vendor/golang.org/x/net/idna.s                       21271    21239    -32     -0.150%
internal/trace/raw.s                                 15413    15400    -13     -0.084%
go/printer.s                                         93669    93655    -14     -0.015%
net.s                                                299569   299568   -1      -0.000%
html/template.s                                      97069    97067    -2      -0.002%
vendor/golang.org/x/net/http/httpguts.s              3187     3181     -6      -0.188%
mime/multipart.s                                     31070    31065    -5      -0.016%
go/build.s                                           75077    75062    -15     -0.020%
crypto/x509.s                                        177195   177104   -91     -0.051%
cmd/cgo.s                                            215638   215629   -9      -0.004%
fmt [cmd/compile].s                                  86358    86294    -64     -0.074%
cmd/compile/internal/base.s                          44380    44368    -12     -0.027%
net/url [cmd/compile].s                              37222    37166    -56     -0.150%
text/tabwriter [cmd/compile].s                       9649     9630     -19     -0.197%
go/doc/comment [cmd/compile].s                       49512    49488    -24     -0.048%
encoding/json [cmd/compile].s                        110712   110707   -5      -0.005%
cmd/doc.s                                            54581    54574    -7      -0.013%
go/types.s                                           558219   558168   -51     -0.009%
cmd/compile/internal/syntax.s                        181755   181724   -31     -0.017%
cmd/go/internal/str.s                                3166     3151     -15     -0.474%
cmd/compile/internal/base [cmd/compile].s            44589    44577    -12     -0.027%
cmd/compile/internal/syntax [cmd/compile].s          196105   196095   -10     -0.005%
cmd/vendor/golang.org/x/mod/module.s                 19140    19108    -32     -0.167%
cmd/vendor/golang.org/x/mod/sumdb/note.s             12831    12829    -2      -0.016%
cmd/go/internal/base.s                               20413    20391    -22     -0.108%
go/build [cmd/compile].s                             75188    75173    -15     -0.020%
cmd/vendor/golang.org/x/mod/modfile.s                116513   116496   -17     -0.015%
cmd/link/internal/benchmark.s                        4068     4045     -23     -0.565%
cmd/internal/script.s                                83442    83435    -7      -0.008%
cmd/go/internal/modindex.s                           83527    83518    -9      -0.011%
cmd/pack.s                                           9128     9111     -17     -0.186%
cmd/compile/internal/types2.s                        540279   540228   -51     -0.009%
net/http.s                                           620639   620613   -26     -0.004%
cmd/compile/internal/types2 [cmd/compile].s          577279   577228   -51     -0.009%
net/http/cookiejar.s                                 28569    28561    -8      -0.028%
cmd/go/internal/web.s                                16316    16293    -23     -0.141%
cmd/vendor/golang.org/x/text/internal/language.s     57819    57816    -3      -0.005%
cmd/vendor/golang.org/x/tools/go/analysis.s          5528     5523     -5      -0.090%
cmd/vendor/github.com/google/pprof/internal/report.s 83881    83865    -16     -0.019%
cmd/vendor/rsc.io/markdown.s                         117312   117300   -12     -0.010%
cmd/compile/internal/walk.s                          329328   329648   +320    +0.097%
cmd/compile/internal/noder.s                         262295   262286   -9      -0.003%
cmd/compile/internal/walk [cmd/compile].s            350300   350620   +320    +0.091%
cmd/compile/internal/noder [cmd/compile].s           298464   298455   -9      -0.003%
total                                                36179015 36177972 -1043   -0.003%

Change-Id: I191371db975761c24e53bb83bef0c42fa8ba3485
Reviewed-on: https://go-review.googlesource.com/c/go/+/641758
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agospec: remove reference to Go 1.17 spec
Robert Griesemer [Thu, 30 Jan 2025 23:21:55 +0000 (15:21 -0800)]
spec: remove reference to Go 1.17 spec

Also, delete go1.17_spec.html.

Change-Id: I7c78029dcfbbe8dbabb4ca81052976c1c8f4ed9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/645717
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>

6 months agogo/parser, go/types, syntax, types2: report invalid uses of ... by parsers
Robert Griesemer [Mon, 25 Nov 2024 21:08:34 +0000 (13:08 -0800)]
go/parser, go/types, syntax, types2: report invalid uses of ... by parsers

Check correct use of ...'s in parameter lists in parsers.
This allows the type checkers to assume correct ASTs with
respect to ... use.

Adjust some error messages: if a ... is used in a result
parameter list, the error is now more accurate.

Eliminate a now unused error code.

Change-Id: I66058e114e84805e24c59e570604b607ef5ff1fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/631135
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>

6 months agocmd/go: update new test for removal of nocoverageredesign
Ian Lance Taylor [Mon, 3 Feb 2025 21:45:27 +0000 (13:45 -0800)]
cmd/go: update new test for removal of nocoverageredesign

The new test was committed after the removal was tested.

For #51430
For #65570
For #70244

Change-Id: I5f94c36a68ea96ba76d018dc06a5a233ad684aa5
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/646355
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

6 months agogo/parser: refactor parameter parsing (cleanup)
Robert Griesemer [Thu, 21 Nov 2024 23:53:05 +0000 (15:53 -0800)]
go/parser: refactor parameter parsing (cleanup)

Refactor parser.parseParameters to only parse
ordinary parameters. Introduce a variant to
parse type parameters.

In the two places where we need ordinary and type
parameters, call the function twice.

Also, use a range loop in two places which is a
bit easier to read.

Change-Id: I0a62e1c508d6ccd16b7cb6e1b852ab1d32224ec2
Reviewed-on: https://go-review.googlesource.com/c/go/+/630816
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Commit-Queue: Robert Griesemer <gri@google.com>

6 months agosyscall: use consistent message for ESTALE on Linux
Ian Lance Taylor [Fri, 17 Jan 2025 17:59:50 +0000 (09:59 -0800)]
syscall: use consistent message for ESTALE on Linux

For some reason the ESTALE error message differed on Linux systems.
On Linux strerror normally returns "Stale file handle" for ESTALE,
except possibly in the en_GB locale. The mkerrors.sh script sets
LC_ALL=C, so it should always produces "stale file handle".
However, for some reason, several targets use "stale NFS file handle"
instead.

Clean this up so that we use the same string on all Linux systems.
This is also consistent with golang.org/x/sys/unix.

Fixes #71309

Change-Id: Ic2ffaf114c85112bc6d0831e43dd5fd2f4237bc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/643335
Auto-Submit: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
6 months agonet: permit Interface with no Name
Ian Lance Taylor [Thu, 9 Jan 2025 21:04:51 +0000 (13:04 -0800)]
net: permit Interface with no Name

On darwin the utun interface sometimes has no name.

Fixes #71064

Change-Id: Iec51641880515f8bd3f97bd892c26f68fd588fa3
Reviewed-on: https://go-review.googlesource.com/c/go/+/641855
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
6 months agointernal/routebsd: simplify for standard library
Ian Lance Taylor [Wed, 18 Dec 2024 22:45:09 +0000 (14:45 -0800)]
internal/routebsd: simplify for standard library

Discard everything we don't need from x/net/route.

Change-Id: If6a4ecb37e5e2349bc4df46c151990719a14f2c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/637696
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

6 months agonet, internal/routebsd: move vendored x/net/route to internal
Ian Lance Taylor [Wed, 18 Dec 2024 22:28:16 +0000 (14:28 -0800)]
net, internal/routebsd: move vendored x/net/route to internal

This is a simple move of the contents of the vendored x/net/route
to internal/routebsd. I've also added some test files that
were not previously vendored.

This next CL will simplify the new internal/routebsd, removing the
code that is not needed by the new package.

This is a step toward simplifying the x/net/route package by
permitting it to import x/sys/unix.

Change-Id: I4d13df11fa9738cd68876b2ea456d03f82d8d64a
Reviewed-on: https://go-review.googlesource.com/c/go/+/637695
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
6 months agoall: remove coverageredesign experiment
Ian Lance Taylor [Tue, 28 Jan 2025 19:27:22 +0000 (11:27 -0800)]
all: remove coverageredesign experiment

The coverageredesign experiment was turned on by default by
CL 436236 in September, 2022. We've documented it and people
are using it. This CL removes the ability to turn off the experiment.
This removes some old code that is no longer being executed.

For #51430

Change-Id: I88d4998c8b5ea98eef8145d7ca6ebd96f64fbc2b
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-darwin-amd64-longtest,gotip-linux-arm64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/644997
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>

6 months agocrypto/internal/fips140/sha3/_asm: remove unnecessary x/crypto dependency
qmuntal [Tue, 17 Dec 2024 09:51:36 +0000 (10:51 +0100)]
crypto/internal/fips140/sha3/_asm: remove unnecessary x/crypto dependency

There is no need to blank-import golang.org/x/crypto/sha3, as we are not
using any crypto.SHA3 variant in the code.

Change-Id: Ia5455647f737371fc4ec0972bf9a90d5ee854495
Reviewed-on: https://go-review.googlesource.com/c/go/+/637055
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

6 months agoall: replace reflect.Value.Type.Kind with reflect.Value.Kind
Sean Liao [Sun, 1 Dec 2024 20:06:26 +0000 (20:06 +0000)]
all: replace reflect.Value.Type.Kind with reflect.Value.Kind

Fixes #46107

Change-Id: I170f3cacda652752cd740e04b565a616a0e43fd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/632635
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>