]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
23 months ago[dev.unified] all: merge master (5a1c5b8) into dev.unified
Matthew Dempsky [Fri, 24 Jun 2022 20:48:30 +0000 (13:48 -0700)]
[dev.unified] all: merge master (5a1c5b8) into dev.unified

Conflicts:

- test/run.go

  Textual conflict adding to the known failures list for the nounified
  frontend.

Merge List:

+ 2022-06-24 5a1c5b8ae7 cmd/go: add per-package indexing for modules outside mod cache
+ 2022-06-24 b9c4d94fdb cmd/go/internal/list: update help info with Deprecated field
+ 2022-06-24 73475ef035 go/types, types2: print qualified object names in cycle errors
+ 2022-06-24 3e58ef6cc7 go/types, types2: better errors for == when type sets are empty
+ 2022-06-24 d38f1d13fa doc/go1.19: Linux race detector now requires glibc 2.17
+ 2022-06-23 de5329f1de debug/dwarf: handle malformed line table with bad program offset
+ 2022-06-23 15605ca827 embed: document additional file name restrictions
+ 2022-06-22 2e773a3894 test: add test that causes gofrontend crash
+ 2022-06-22 ff17b7d0d4 cmd/compile: don't use dictionary convert to shaped empty interface
+ 2022-06-22 2a3b467d5f cmd/go: make module .zip files group/world readable
+ 2022-06-22 bdab4cf47a cmd/go, cmd/link: support failure to create _cgo_import.go
+ 2022-06-22 aca37d16a5 cmd/go: avoid indexing modules in GOROOT
+ 2022-06-22 111cdb5848 all: update to current golang.org/x/sys revision
+ 2022-06-22 4045b1bc3f cmd/compile: fix assert condition in generic method call
+ 2022-06-22 6bad7e8243 compress/gzip: always close bodyReader in Example_compressingReader
+ 2022-06-22 606c6c371a encoding/xml: check nil pointer in DecodeElement
+ 2022-06-22 f571518139 cmd/cgo: dont override declared struct type
+ 2022-06-22 92c9b81447 net: don't set netGo = true on Windows with no cgo
+ 2022-06-22 be0b2a393a cmd/trace: add basic documentation to main page
+ 2022-06-22 b004c739b5 go/types, types2: fix parameter order dependence in type inference
+ 2022-06-21 f2c7e78592 spec: document operations which accept []byte|string constrained types
+ 2022-06-21 ab422f2749 runtime/trace: ignore fallback stacks in test
+ 2022-06-21 66685fb7dd doc/go1.19: use correct link to sync/atomic docs
+ 2022-06-21 4b236b45d0 runtime: convert flaky semaphore linearity test into benchmark
+ 2022-06-21 530511bacc cmd/go/internal/modindex: avoid walking modules when not needed
+ 2022-06-21 c2d373d5d1 cmd/compile: allow 128-bit values to be spilled
+ 2022-06-21 19ed442807 test: add regress test for #53477
+ 2022-06-20 3fcbfb07a8 doc/go1.19: fix HTML validation issues
+ 2022-06-18 527ace0ffa cmd/compile: skip substituting closures in unsafe builtins arguments
+ 2022-06-17 ec58e3f327 test: add regress test for #53419
+ 2022-06-17 103cc661f1 cmd/go/internal/modfetch: prevent duplicate hashes in go.sum
+ 2022-06-17 d42a48828f sync: add more notes about Cond behavior
+ 2022-06-17 9e2f289754 cmd/go/internal/work: log clearer detail for subprocess errors in (*Builder).toolID
+ 2022-06-17 dd2d00f9d5 net: fix flaky *TimeoutMustNotReturn tests
+ 2022-06-17 6c25ba624f go/token: delete unused File.set field
+ 2022-06-16 9068c6844d cmd/dist: add package . to 'go test' commands
+ 2022-06-16 7bad61554e runtime: write much more direct test for semaphore waiter scalability
+ 2022-06-16 f38a580a51 cmd/go: add more tracing

Change-Id: I912c5879165e03f4d7f8ac3ee9241d50fc92a419

23 months agocmd/go: add per-package indexing for modules outside mod cache
Michael Matloob [Thu, 23 Jun 2022 19:46:29 +0000 (15:46 -0400)]
cmd/go: add per-package indexing for modules outside mod cache

Packages outside the module cache including the standard library will be
indexed individually rather than as a whole module.

For #52876

Change-Id: I142dad6a790e9e8eb4dc6430a588fbfa86552e49
Reviewed-on: https://go-review.googlesource.com/c/go/+/413815
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agocmd/go/internal/list: update help info with Deprecated field
Sean Liao [Tue, 22 Mar 2022 22:00:22 +0000 (22:00 +0000)]
cmd/go/internal/list: update help info with Deprecated field

Also align Retracted documentation with actual type of []string

Fixes #51876

Change-Id: I3b34e53424aa7ee5330eb71adac23510fff91798
Reviewed-on: https://go-review.googlesource.com/c/go/+/394677
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
23 months agogo/types, types2: print qualified object names in cycle errors
Robert Griesemer [Fri, 24 Jun 2022 00:53:01 +0000 (17:53 -0700)]
go/types, types2: print qualified object names in cycle errors

Fixes #50788.

Change-Id: Id1ed7d9c0687e3005e28598373fd5634178c78ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/413895
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
23 months agogo/types, types2: better errors for == when type sets are empty
Robert Griesemer [Fri, 24 Jun 2022 03:54:52 +0000 (20:54 -0700)]
go/types, types2: better errors for == when type sets are empty

For #51525.

Change-Id: I3762bc4a48a1aaab3b006b1ad1400f866892243c
Reviewed-on: https://go-review.googlesource.com/c/go/+/413934
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
23 months agodoc/go1.19: Linux race detector now requires glibc 2.17
Ian Lance Taylor [Fri, 24 Jun 2022 00:23:39 +0000 (17:23 -0700)]
doc/go1.19: Linux race detector now requires glibc 2.17

Fixes #53522

Change-Id: Ibed838d358a733d26a6c3d89446d7fadb1012961
Reviewed-on: https://go-review.googlesource.com/c/go/+/413876
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile: rename haveRType and implicitExpr
Matthew Dempsky [Thu, 23 Jun 2022 20:07:32 +0000 (13:07 -0700)]
[dev.unified] cmd/compile: rename haveRType and implicitExpr

This CL renames:

1. "haveRType" to "hasRType", suggested by drchase@ during review of
CL 413358; and

2. "implicitExpr" to "implicitConvExpr", suggested by khr@ during
review of CL 413396.

Change-Id: Ibb4deae20908d960706640991ea44d1b9c0b9e3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/413854
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
23 months ago[dev.unified] cmd/compile: implicit conversions for return statements
Matthew Dempsky [Tue, 21 Jun 2022 19:02:03 +0000 (12:02 -0700)]
[dev.unified] cmd/compile: implicit conversions for return statements

This CL inserts implicit conversions for simple N:N return
statements. A subsequent CL will handle N:1 return statements.

Change-Id: Ia672db3e214025510485e17d3d50d42ff01bc74e
Reviewed-on: https://go-review.googlesource.com/c/go/+/413517
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile/internal/noder: implicit conversions for writer.assignStmt
Matthew Dempsky [Tue, 21 Jun 2022 19:51:01 +0000 (12:51 -0700)]
[dev.unified] cmd/compile/internal/noder: implicit conversions for writer.assignStmt

This CL inserts implicit conversions for simple N:N assignment
statements within Unified IR. A subsequent CL will handle N:1
assignments.

Change-Id: I7e204c6ee9ffdb9fa2bc9146315fd79735c04628
Reviewed-on: https://go-review.googlesource.com/c/go/+/413516
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile/internal/noder: refactor stmtAssign generation
Matthew Dempsky [Tue, 21 Jun 2022 18:49:27 +0000 (11:49 -0700)]
[dev.unified] cmd/compile/internal/noder: refactor stmtAssign generation

Eliminate some code duplication between assignment statements and
variable declarations, so they're easier to extend with implicit
conversions.

Change-Id: I605cf7817e3cb230f2c4612b777d8023c926e8b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/413515
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile/internal/noder: implicit conversion of call arguments
Matthew Dempsky [Tue, 21 Jun 2022 18:31:11 +0000 (11:31 -0700)]
[dev.unified] cmd/compile/internal/noder: implicit conversion of call arguments

Function call arguments need to be implicitly converted to their
respective parameter types. This CL updates the Unified IR writer to
handle this case, at least for typical function calls. I'll handle
f(g()) calls is a subsequent CL.

Change-Id: I7c031d21f57885c9516eaf89eca517977bf9e39a
Reviewed-on: https://go-review.googlesource.com/c/go/+/413514
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile/internal/noder: remove needType logic
Matthew Dempsky [Tue, 21 Jun 2022 14:56:25 +0000 (07:56 -0700)]
[dev.unified] cmd/compile/internal/noder: remove needType logic

This logic is a holdover from very early on when it wasn't as clear
how we would handle dictionary entries for derived types, particularly
ones that are emitted during desugaring.

However, the current plan is to explicitly wire runtime type info
through IR nodes, so we can drop this logic.

Notably, the "needed" bit is exposed to the go/types importers, so
removing it would break the x/tools importer. To minimize churn for
now, we can just leave the bools in place.

Change-Id: I374927887d4f3d6d711d3355607849a407d717c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/413367
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>

23 months ago[dev.unified] cmd/compile/internal/noder: implicit conversions for complits
Matthew Dempsky [Tue, 21 Jun 2022 14:39:23 +0000 (07:39 -0700)]
[dev.unified] cmd/compile/internal/noder: implicit conversions for complits

Operands within a composite literal must be implicitly converted to
their respective key/element type.

Change-Id: Idc12eba1559e9c9ffebd03395cd91473dd5fc2db
Reviewed-on: https://go-review.googlesource.com/c/go/+/413364
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
23 months ago[dev.unified] cmd/compile/internal/noder: start writing implicit conversions
Matthew Dempsky [Tue, 21 Jun 2022 14:07:41 +0000 (07:07 -0700)]
[dev.unified] cmd/compile/internal/noder: start writing implicit conversions

This CL adds support for implicit conversions to the unified IR export
data format, and starts inserting them in a few low-hanging
places (send statements, index expressions).

Subsequentl CLs will handle the remaining trickier cases.

Change-Id: Iaea9d1c5df8432b61bd82578ab2ef02adaf26367
Reviewed-on: https://go-review.googlesource.com/c/go/+/413396
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile/internal/noder: add pkgWriter.typeOf helper
Matthew Dempsky [Tue, 21 Jun 2022 13:36:28 +0000 (06:36 -0700)]
[dev.unified] cmd/compile/internal/noder: add pkgWriter.typeOf helper

Getting the type of a value expression is already a very common
operation during writing, and it's going to become more common to
handle implicit conversions.

Change-Id: I5401c6b01546bbf8e85b1ed3fe4acf2835925e2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/413395
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile/internal/typecheck: replace unreachable code with assert
Matthew Dempsky [Tue, 21 Jun 2022 12:22:00 +0000 (05:22 -0700)]
[dev.unified] cmd/compile/internal/typecheck: replace unreachable code with assert

Since the removal of -G=0 mode, IR is always well-typed. And in
well-typed IR, convlit will always returns expressions having real
types (i.e., not untyped).

Change-Id: I1ac99a88c94777829852519347a716d19af7948c
Reviewed-on: https://go-review.googlesource.com/c/go/+/413363
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
23 months ago[dev.unified] cmd/compile: special case f(g()) calls in Unified IR
Matthew Dempsky [Tue, 21 Jun 2022 11:41:38 +0000 (04:41 -0700)]
[dev.unified] cmd/compile: special case f(g()) calls in Unified IR

For f(g()) calls where g() is multi-valued, we may need to insert
implicit conversions to convert g()'s result values to f()'s parameter
types. This CL refactors code slightly so this will be easier to
handle.

Change-Id: I3a432220dcb62daecf9a66030e8fa1f097e95f95
Reviewed-on: https://go-review.googlesource.com/c/go/+/413362
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>

23 months ago[dev.unified] cmd/compile: plumb rtype through OSWITCH/OCASE clauses
Matthew Dempsky [Tue, 21 Jun 2022 09:30:21 +0000 (02:30 -0700)]
[dev.unified] cmd/compile: plumb rtype through OSWITCH/OCASE clauses

For (value) switch statements, we may generate OEQ comparisons between
values of interface and concrete type, which in turn may require
access to the concrete type's RType.

To plumb this through, this CL adds CaseClause.RTypes to hold the
rtype values, updates the GOEXPERIMENT=unified frontend to set it, and
updates walk to plumb rtypes through into generated OEQ nodes.

Change-Id: I6f1de2a1167ce54f5770147498a0a591efb3f012
Reviewed-on: https://go-review.googlesource.com/c/go/+/413361
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile: plumb rtype through for OMAPLIT
Matthew Dempsky [Tue, 21 Jun 2022 09:29:49 +0000 (02:29 -0700)]
[dev.unified] cmd/compile: plumb rtype through for OMAPLIT

OMAPLIT gets lowered into a bunch of OINDEXMAP operations, which in
general may require a *runtime._type argument. This CL adds
CompLitExpr.RType, updates the GOEXPERIMENT=unified frontend to start
setting it, and updates walk to propagate it through to any generated
OINDEXMAP operations.

Change-Id: I278e7e8e615ea6d01f65a5eba6d6fc8e00045735
Reviewed-on: https://go-review.googlesource.com/c/go/+/413360
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile: start setting RType fields for Unified IR
Matthew Dempsky [Tue, 21 Jun 2022 07:57:18 +0000 (00:57 -0700)]
[dev.unified] cmd/compile: start setting RType fields for Unified IR

This CL switches the GOEXPERIMENT=unified frontend to set RType fields
in the simpler cases, and to make it fatal if they're missing.

Subsequent CLs will handle the remaining more complex cases (e.g.,
expressions from later desugaring, and implicit conversions to
interface type).

Change-Id: If6257dcb3916905afd9b8371ea64b85f108ebbfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/413359
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
23 months ago[dev.unified] cmd/compile: add RType fields
Matthew Dempsky [Tue, 21 Jun 2022 06:21:16 +0000 (23:21 -0700)]
[dev.unified] cmd/compile: add RType fields

This CL adds RType/ITab fields to IR nodes that (may) ultimately
become runtime calls that require a *runtime._type or *runtime.itab
argument. It also updates the corresponding reflectdata IR helpers to
use these fields in preference of calling TypePtr/ITabAddr.

Subsequent CLs will start updating the GOEXPERIMENT=unified frontend
to set the RType fields, and incrementally switch the reflectdata
helpers to require them.

Passes toolstash -cmp.

Change-Id: I30e31d91f0a53961e3d6d872d7b5f9df2ec5074c
Reviewed-on: https://go-review.googlesource.com/c/go/+/413358
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>

23 months agodebug/dwarf: handle malformed line table with bad program offset
Than McIntosh [Thu, 23 Jun 2022 18:11:59 +0000 (14:11 -0400)]
debug/dwarf: handle malformed line table with bad program offset

Touch up the line table reader to ensure that it can detect and reject
an invalid program offset field in the table header.

Fixes #53329.

Change-Id: Ia8d684e909af3aca3014b4a3d0dfd431e3f5a9f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/413814
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
23 months agoembed: document additional file name restrictions
tulip [Tue, 21 Jun 2022 16:42:29 +0000 (00:42 +0800)]
embed: document additional file name restrictions

For #44486

Change-Id: I66af9f7a9f95489a41fd6710e50bdd7878f78b85
Reviewed-on: https://go-review.googlesource.com/c/go/+/413494
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

23 months agotest: add test that causes gofrontend crash
Ian Lance Taylor [Wed, 22 Jun 2022 23:02:45 +0000 (16:02 -0700)]
test: add test that causes gofrontend crash

For #52846

Change-Id: I763f81def97b53277396c123c524f7b8193ea35e
Reviewed-on: https://go-review.googlesource.com/c/go/+/413694
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
23 months agocmd/compile: don't use dictionary convert to shaped empty interface
Wayne Zuo [Tue, 7 Jun 2022 01:12:21 +0000 (09:12 +0800)]
cmd/compile: don't use dictionary convert to shaped empty interface

Fixes: #53254
Change-Id: I3153d6ebb9f25957b09363f45c5cd4651ee84c2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/410655
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
23 months agocmd/go: make module .zip files group/world readable
Dmitri Goutnik [Sat, 7 May 2022 21:10:16 +0000 (16:10 -0500)]
cmd/go: make module .zip files group/world readable

os.CreateTemp in downloadZip leaves downloaded .zip files readable only
by the owner. Make them group/world readable.

Fixes #52765

Change-Id: Iace13e4ad813201a533a1a5fc0c6d9b2e5349a42
Reviewed-on: https://go-review.googlesource.com/c/go/+/404854
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>

23 months agocmd/go, cmd/link: support failure to create _cgo_import.go
Ian Lance Taylor [Wed, 22 Jun 2022 01:11:32 +0000 (18:11 -0700)]
cmd/go, cmd/link: support failure to create _cgo_import.go

For a package that uses cgo, the file _cgo_import.go is created to
record information required for internal linking: the non-Go dynamic
symbols and libraries that the package depends on. Generating this
information sometimes fails, because it can require recreating all the
dependencies of all transitively imported packages. And the
information is rarely needed, since by default we use external linking
when there are packages outside of the standard library that use cgo.

With this CL, if generating _cgo_import.go fails, we don't report an
error. Instead, we mark the package as requiring external linking, by
adding an empty file named "dynimportfail" into the generated archive.
If the linker sees a file with that name, it rejects an attempt to use
internal linking.

Fixes #52863

Change-Id: Ie586e6753a5b67e49bb14533cd7603d9defcf0ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/413460
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agocmd/go: avoid indexing modules in GOROOT
Bryan C. Mills [Wed, 22 Jun 2022 19:19:54 +0000 (15:19 -0400)]
cmd/go: avoid indexing modules in GOROOT

Scanning GOROOT modules for changes appears to be causing Windows
builders to time out in x/tools tests. We may try a per-package index
instead, but for now just skip GOROOT modules (as we do for main
modules).

Fixes #53493.

Change-Id: Ic5bb90b4ce173a24fc6564e85fcde96e1f9b975f
Reviewed-on: https://go-review.googlesource.com/c/go/+/413634
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
23 months agoall: update to current golang.org/x/sys revision
Guoqi Chen [Wed, 15 Jun 2022 11:07:24 +0000 (19:07 +0800)]
all: update to current golang.org/x/sys revision

go get -d golang.org/x/sys@6c1b26c55098eae66ce95ab7c3712ab6cbfff2b7
go mod tidy
go mod vendor

This fixes the problem of the second return value in syscall on linux/loong64.

Change-Id: I8018ae96f4e5ca9779b2c053cdccc6b2866bf0de
Reviewed-on: https://go-review.googlesource.com/c/go/+/412274
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agocmd/compile: fix assert condition in generic method call
Wayne Zuo [Thu, 16 Jun 2022 03:05:39 +0000 (11:05 +0800)]
cmd/compile: fix assert condition in generic method call

Fixes #53406.

Change-Id: If7ae39ec1042a792d82a0a2de96d168c22d8ab71
Reviewed-on: https://go-review.googlesource.com/c/go/+/412614
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
Auto-Submit: Alex Rakoczy <alex@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>

23 months agocompress/gzip: always close bodyReader in Example_compressingReader
Ian Lance Taylor [Fri, 17 Jun 2022 20:38:07 +0000 (13:38 -0700)]
compress/gzip: always close bodyReader in Example_compressingReader

For #53362
Fixes #53414

Change-Id: I352164e70c136eed210c7ee4ceba5dc631f81f94
Reviewed-on: https://go-review.googlesource.com/c/go/+/412955
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agoencoding/xml: check nil pointer in DecodeElement
shaoliming [Fri, 17 Jun 2022 05:01:26 +0000 (05:01 +0000)]
encoding/xml: check nil pointer in DecodeElement

Fixes #53350

Change-Id: Id5e1f4016db5f1d4349ee1a76a9dfe3aeae83cee
GitHub-Last-Rev: 45add121612a8144c2525828bd7386c4adb05174
GitHub-Pull-Request: golang/go#53407
Reviewed-on: https://go-review.googlesource.com/c/go/+/412634
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alex Rakoczy <alex@golang.org>
23 months agocmd/cgo: dont override declared struct type
kkHAIKE [Wed, 11 May 2022 02:27:21 +0000 (02:27 +0000)]
cmd/cgo: dont override declared struct type

Fixes #52611

Change-Id: I835df8d6a98a37482446ec00af768c96fd8ee4fe
GitHub-Last-Rev: ea54dd69eef90eaf1641889039344fff70158ece
GitHub-Pull-Request: golang/go#52733
Reviewed-on: https://go-review.googlesource.com/c/go/+/404497
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dexter Ouyang <kkhaike@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Alex Rakoczy <alex@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agonet: don't set netGo = true on Windows with no cgo
Ian Lance Taylor [Tue, 21 Jun 2022 22:17:22 +0000 (15:17 -0700)]
net: don't set netGo = true on Windows with no cgo

Windows can call the C DNS lookup routines even without cgo,
so don't force it to use the Go routines in that scenario.

No test because the test requires building the tools with CGO_ENABLED=0.

For #33097
Fixes #53490

Change-Id: I3595a68e788be0d3bbd1bbd431836aca20a7d757
Reviewed-on: https://go-review.googlesource.com/c/go/+/413458
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

23 months agocmd/trace: add basic documentation to main page
Alan Donovan [Fri, 17 Jun 2022 14:32:52 +0000 (10:32 -0400)]
cmd/trace: add basic documentation to main page

This change adds rudimentary explanation of the various
visualizations to main page of the trace server.
There is clearly a vast amount one could write here,
especially in the form of tutorials, but I've tried to
restrict it to just basic conceptual overview.

Change-Id: Id4dfe9d47f9b31ed5f8fe39f8b3a7c60c0ae8d5a
Reviewed-on: https://go-review.googlesource.com/c/go/+/412876
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agogo/types, types2: fix parameter order dependence in type inference
Robert Griesemer [Tue, 21 Jun 2022 22:56:16 +0000 (15:56 -0700)]
go/types, types2: fix parameter order dependence in type inference

If we have more than two function arguments to a generic function,
we may have arguments with named and unnamed types. If that is the
case, permutate params and args such that the arguments with named
types are first in the list. This way, independent of parameter
ordering, the type inference will produce the same result.

This extra step is not explicitly outlined in the spec yet but we
all agree that (parameter) order independence is an invariant that
we should uphold for type inference. As we move towards less
operational and more descriptive rules for type inference, we will
incorporate this property as well.

The actual fix for this bug existed before 1.18 but was not enabled.
This CL merely enables the fix (switches a flag) and adjusts some
tests.

Fixes #43056.

Change-Id: Ie4e40cf8438dfd82fa94b78068e4f6f6f53f83e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/413459
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
23 months ago[dev.unified] cmd/compile: avoid reflectType in ssagen
Matthew Dempsky [Tue, 21 Jun 2022 05:28:15 +0000 (22:28 -0700)]
[dev.unified] cmd/compile: avoid reflectType in ssagen

This CL adds alternate code paths for the frontend to plumb through
rtypes to package ssagen, so the latter doesn't have to use
reflectType (which in general will only have access to shape types).

Note: This CL doesn't yet plumb through the rtypes for variables that
escape to the heap. However, those rtypes are only used for calling
runtime.newobject, and the status quo as of Go 1.18 is already to use
shape rtypes for most runtime.newobject calls. (Longer term though, I
would like to get rid of shape rtypes altogether.)

Passes toolstash -cmp.

Updates #53276.

Change-Id: I76a281eca8300de2e701fbac89ead32f8568a5f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/413357
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
23 months ago[dev.unified] cmd/compile: extract rtype code from walk
Matthew Dempsky [Tue, 14 Jun 2022 23:07:46 +0000 (16:07 -0700)]
[dev.unified] cmd/compile: extract rtype code from walk

This CL removes (almost*) all reflectdata.{TypePtr,ITabAddr} calls
from package walk. This will allow us to next start adding RType/ITab
fields to IR nodes directly, and have the helpers start returning them
when available instead.

The one survining ITabAddr call is due to ODOTTYPE{,2}, but we already
have ODYNAMICDOTTYPE{,2}, which I plan to have Unified IR always
use. (Longer term, once the Go 1.18 frontend is gone, we can get rid
of ODOTTYPE*, and rename ODYNAMICDOTTYPE*.)

Passes toolstash -cmp.

Change-Id: I5e00da06a93d069abf383d7628e692dd7fd2a1c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/413356
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months ago[dev.unified] cmd/compile: refactor reflectdata.{TypePtr,ITabAddr}
Matthew Dempsky [Tue, 14 Jun 2022 23:11:17 +0000 (16:11 -0700)]
[dev.unified] cmd/compile: refactor reflectdata.{TypePtr,ITabAddr}

Minor refactoring to decouple from base.Pos and deduplicate some
common code paths.

Passes toolstash -cmp.

Change-Id: I8c0724cf821d28b0ede3b0e8e4b2d02302d9af3b
Reviewed-on: https://go-review.googlesource.com/c/go/+/413355
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
23 months agospec: document operations which accept []byte|string constrained types
Robert Griesemer [Wed, 15 Jun 2022 01:30:44 +0000 (18:30 -0700)]
spec: document operations which accept []byte|string constrained types

Pre-1.18, as special cases, the built-in operations append and copy
accepted strings as second arguments if the first argument was a byte
slice. With Go 1.18, these two built-ins as well as slice expressions
rely on the notion of core types in their specification.

Because we want to permit slice expressions, append, and copy to
operate on (1st or 2nd operands) that are type parameters restricted
by []byte | string (and variations thereof), the simple notion of
core type is not sufficient for these three operations. (The compiler
already permits such more relaxed operations).

In the section on core types, add a paragraph and examples introducing
the (artificial) core type "bypestring", which describes the core type
of type sets whose underlying types are []byte or string. Adjust the
rules for slice expressions, append, and copy accordingly.

Also (unrelated): Adjust prose in the only paragraph where we used
personal speech ("we") to impersonal speech, to match the rest of
the spec.

Fixes #52859.

Change-Id: I1cbda3095a1136fb99334cc3a62a9a349a27ce1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/412234
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
23 months agoruntime/trace: ignore fallback stacks in test
Rhys Hiltner [Tue, 21 Jun 2022 19:28:48 +0000 (12:28 -0700)]
runtime/trace: ignore fallback stacks in test

When runtime.sigprof encounters a stack that gentraceback is unable to
process, it synthesizes a call stack with a sentinel function (such as
runtime._System) at the leaf.

The test to confirm that runtime/trace and runtime/pprof have similar
views of CPU profile samples has trouble with those stacks. The test
confirms that the samples match by confirming that their symbolized
forms match, and the symbolization procedure is very different for the
two packages.

Skip the samples that the CPU profiler's view symbolizes to include one
of runtime.sigprof's sentinel functions at the leaf. (The test design
expects the CPU profiler to under-report samples relative to the
execution tracer.)

Fixes #53378

Change-Id: I60c27de4c69b454057d28a3b6e12d70369de4c4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/413457
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
23 months agodoc/go1.19: use correct link to sync/atomic docs
Ian Lance Taylor [Mon, 20 Jun 2022 05:57:10 +0000 (22:57 -0700)]
doc/go1.19: use correct link to sync/atomic docs

For #51400
Fixes #53453

Change-Id: Ie11182a16299cf26d03970d6aa9bfe03caa56ea4
Reviewed-on: https://go-review.googlesource.com/c/go/+/413235
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

23 months agoruntime: convert flaky semaphore linearity test into benchmark
Michael Anthony Knyszek [Fri, 17 Jun 2022 19:56:27 +0000 (19:56 +0000)]
runtime: convert flaky semaphore linearity test into benchmark

Also, add a benchmark for another case that was originally tested.

Also also, remove all the dead code this now creates.

Fixes #53428.

Change-Id: Idbba88d3d31d38a8854fd5ed99001e394da27300
Reviewed-on: https://go-review.googlesource.com/c/go/+/412878
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>

23 months ago[dev.unified] cmd/compile/internal/walk: minor prep refactoring
Matthew Dempsky [Tue, 14 Jun 2022 22:34:05 +0000 (15:34 -0700)]
[dev.unified] cmd/compile/internal/walk: minor prep refactoring

Two small refactorings that will make it easier to thread through
RType parameters later. Behavior preserving, but seemed worth
separating out.

Passes toolstash -cmp.

Change-Id: I77905775015b6582bad2b32dd7700880c415893f
Reviewed-on: https://go-review.googlesource.com/c/go/+/413354
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

23 months agocmd/go/internal/modindex: avoid walking modules when not needed
Bryan C. Mills [Thu, 16 Jun 2022 22:02:11 +0000 (18:02 -0400)]
cmd/go/internal/modindex: avoid walking modules when not needed

Due to a missed condition in CL 412394, we were walking all modules
(instead of just the ones contained in GOROOT) at each invocation of a
devel version of cmd/go.

Moreover, while we were running cmd/go tests, we were re-walking
GOROOT at each 'go' invocation in the test even though we expect
GOROOT to be stable within a test run.

This change always avoids walking non-GOROOT modules, and also adds a
salt (configurable via GODEBUG) and uses it to avoid walking GOROOT
modules when GOROOT is known to be stable (such as over the course of
a 'cmd/go' test run).

This should fix the cmd/go test timeouts that are currently occurring
on the dragonfly-amd64 builder, such as this one:
https://build.golang.org/log/21c01c3ae5490d387d84abeaf872b3a0a76ab8e5

Updates #53290.

Change-Id: Ic807d215831a3cd21c63e0bccd3d7acd10d8f2b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/412779
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
23 months agocmd/compile: allow 128-bit values to be spilled
Keith Randall [Tue, 21 Jun 2022 00:06:09 +0000 (17:06 -0700)]
cmd/compile: allow 128-bit values to be spilled

We sometimes use 16-byte load+store to move values around in memory.
In rare circumstances, the loaded value must be spilled because the
store can't happen yet.

In that case, we need to be able to spill the 16-byte value.

Fixes #53454

Change-Id: I09fd08e11a63c6ba3ef781d3f5ede237e9b0132e
Reviewed-on: https://go-review.googlesource.com/c/go/+/413294
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
23 months agotest: add regress test for #53477
Matthew Dempsky [Tue, 21 Jun 2022 14:15:33 +0000 (07:15 -0700)]
test: add regress test for #53477

This test already passes for GOEXPERIMENT=unified; add regress test to
ensure it stays that way.

Updates #53477.

Change-Id: Ib7aa7428260595077052207899edcc044a6ab1c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/413394
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
23 months agodoc/go1.19: fix HTML validation issues
Tobias Klauser [Mon, 20 Jun 2022 09:42:07 +0000 (11:42 +0200)]
doc/go1.19: fix HTML validation issues

Avoid duplicating tag ID runtime and remove a superflous </dd> tag.

Found by https://validator.w3.org

Change-Id: I9c84b8257acbb6d3d6817192bb8d355207944b9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/413254
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

2 years agocmd/compile: skip substituting closures in unsafe builtins arguments
Cuong Manh Le [Thu, 16 Jun 2022 16:04:25 +0000 (23:04 +0700)]
cmd/compile: skip substituting closures in unsafe builtins arguments

For unsafe.{Alignof,Offsetof,Sizeof}, subster will transform them them
to OLITERAL nodes, and discard their arguments. However, any closure in
their children nodes were already processed and added to declaration
queue. Thus, we lack of information for generating instantiation for
the closure.

To fix it, just skip substituting the closures if we are going to edit
the children nodes of unsafe builtins.

Fixes #53390

Change-Id: Ia815cd05af9dc0491f10faac4399f378ac53dec6
Reviewed-on: https://go-review.googlesource.com/c/go/+/412794
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2 years agotest: add regress test for #53419
Matthew Dempsky [Fri, 17 Jun 2022 22:19:59 +0000 (15:19 -0700)]
test: add regress test for #53419

This currently works with GOEXPERIMENT=unified. Add a regress test to
make sure it stays that way.

Updates #53419.

Change-Id: I2ea1f9039c59807fbd497d69a0420771f8d6d035
Reviewed-on: https://go-review.googlesource.com/c/go/+/413014
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agocmd/go/internal/modfetch: prevent duplicate hashes in go.sum
Josh Powers [Fri, 17 Jun 2022 18:22:12 +0000 (18:22 +0000)]
cmd/go/internal/modfetch: prevent duplicate hashes in go.sum

To write go.sum, each module and then each hash is looped through. The
hashes are kept in a slice and there is no check to ensure that hashes
were not added or already exist in the file. Therefore, unique the
hashes of each module before writing to prevent duplicates.

Fixes: #28456
Change-Id: I1cf7e7cdee3e7530a0ee605cd76d738627be1e0d
GitHub-Last-Rev: 0ed02e9591e966fe5f6ba275635c3974daa2656e
GitHub-Pull-Request: golang/go#53291
Reviewed-on: https://go-review.googlesource.com/c/go/+/411154
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agosync: add more notes about Cond behavior
Kevin Burke [Wed, 15 Jun 2022 04:29:36 +0000 (21:29 -0700)]
sync: add more notes about Cond behavior

Cond is difficult to use correctly (I was just bitten by it in
a production app that I inherited). While several proposals have come
up to improve or remove sync.Cond, no action has so far been taken.

Update the documentation to discourage use of sync.Cond, and point
people in the direction of preferred alternatives. I believe this will
help encourage behavior we want (less use of sync.Cond and more use of
channels), while also paving the way for, potentially, removing Cond
in a future version of the language.

Thanks very much to Bryan Mills and Sean Liao for discussion and
recommendations.

Updates #20491.
Updates #21165.

Change-Id: Ib4d0631c79d4c4d0a30027255cd43bc47cddebd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/412237
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 years agocmd/go/internal/work: log clearer detail for subprocess errors in (*Builder).toolID
Bryan C. Mills [Fri, 17 Jun 2022 16:34:30 +0000 (12:34 -0400)]
cmd/go/internal/work: log clearer detail for subprocess errors in (*Builder).toolID

For #52647.

Change-Id: Ic12123769d339c2df677500ed59f15a4ee5037d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/412954
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 years agonet: fix flaky *TimeoutMustNotReturn tests
Dmitri Goutnik [Fri, 17 Jun 2022 17:10:09 +0000 (12:10 -0500)]
net: fix flaky *TimeoutMustNotReturn tests

The tester goroutine doesn't always gets a chance to run before the
timeout expires. Wait for the goroutine to start and set deadlines
before staring the timer.

Fixes #36796

Change-Id: Iffed6259de31340c3f66e34da473826a1d09fcde
Reviewed-on: https://go-review.googlesource.com/c/go/+/412858
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agogo/token: delete unused File.set field
Alan Donovan [Wed, 1 Jun 2022 16:54:00 +0000 (12:54 -0400)]
go/token: delete unused File.set field

This field is only used for a sanity check in a test.

Change-Id: I868ed10131ec33994ebb1b1d88f6740956824bd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/409834
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2 years agocmd/dist: add package . to 'go test' commands
Bryan C. Mills [Thu, 16 Jun 2022 19:45:25 +0000 (15:45 -0400)]
cmd/dist: add package . to 'go test' commands

This suppresses verbose output if the test passes,
eliminating some "hello from C" noise for the ../misc/cgo test.

Change-Id: I6324bfb4b3633c20e0eb0ae03aa25d40fab9fcfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/412776
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agoruntime: write much more direct test for semaphore waiter scalability
Michael Anthony Knyszek [Thu, 16 Jun 2022 20:33:35 +0000 (20:33 +0000)]
runtime: write much more direct test for semaphore waiter scalability

This test originally existed as two tests in test/locklinear.go, but
this checked against actual locks and was flaky. The test was checking
a property of a deep part of the runtime but from a much higher level,
and it's easy for nondeterminism due to scheduling to completely mess
that up, especially on an oversubscribed system.

That test was then moved to the sync package with a more rigorous
testing methodology, but it could still flake pretty easily.

Finally, this CL makes semtable more testable, exports it in
export_test.go, then writes a very direct scalability test for exactly
the situation the original test described. As far as I can tell, this is
much, much more stable, because it's single-threaded and is just
checking exactly the algorithm we need to check.

Don't bother trying to bring in a test that checks for O(log n) behavior
on the other kind of iteration. It'll be perpetually flaky because the
underlying data structure is a treap, so it's only _expected_ to be
O(log n), but it's very easy for it to get unlucky without a large
number of iterations that's too much for a simple test.

Fixes #53381.

Change-Id: Ia1cd2d2b0e36d552d5a8ae137077260a16016602
Reviewed-on: https://go-review.googlesource.com/c/go/+/412875
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agocmd/go: add more tracing
Michael Matloob [Tue, 5 Apr 2022 22:47:23 +0000 (18:47 -0400)]
cmd/go: add more tracing

Change-Id: I26ed64c097533ee9276e598653db72efc053c4e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/403156
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2 years ago[dev.unified] all: merge master (635b124) into dev.unified
Matthew Dempsky [Thu, 16 Jun 2022 20:08:10 +0000 (13:08 -0700)]
[dev.unified] all: merge master (635b124) into dev.unified

Merge List:

+ 2022-06-16 635b1244aa cmd/go: pass GOEXPERIMENT through to subtests
+ 2022-06-16 ef808ae1d4 expvar: don't crash if map value set to nil
+ 2022-06-16 32510eea74 go/parser: remove unused method checkBinaryExpr
+ 2022-06-16 74f1fa6ecb cmd/go: parallelize matchPackages work in each module
+ 2022-06-16 1d9d99b7ce cmd/link: consider alignment in carrier symbol size calculation
+ 2022-06-16 bcce8ef498 spec: adjust incorrect sentence in section on rune literals
+ 2022-06-16 ecc268aa26 test: add test that gofrontend fails
+ 2022-06-15 b6c1606889 internal/goarch, internal/goos: update generators for syslist.go
+ 2022-06-15 91baf5cecc reflect: fix reference comment to runtime/map.go
+ 2022-06-15 0e3d0c9581 syscall: clarify Pdeathsig documentation on Linux
+ 2022-06-15 74bf90c779 go/types, types2: add test case for issue for coverage
+ 2022-06-15 0cd0c12f57 doc/go1.19: use matching closing tag in unix build constraint heading
+ 2022-06-15 97bfc77f38 syscall, runtime/internal/syscall: always zero the higher bits of return value on linux/loong64
+ 2022-06-15 937fa5000a net/netip: add missing ) in ParsePrefix errors
+ 2022-06-15 c2c76c6f19 cmd/link: set alignment for carrier symbols
+ 2022-06-15 36147dd1e8 cmd/go/internal/modindex: disable indexing for modules outside GOROOT and the module cache
+ 2022-06-15 2a78e8afc0 test: add tests for string/[]byte/[]rune conversions
+ 2022-06-15 f9c0264107 net: avoid infinite recursion in Windows Resolver.lookupTXT
+ 2022-06-14 0dffda1383 spec: clarify "slice of bytes" and "slice of runes" through examples
+ 2022-06-14 c22a6c3b90 reflect: when StructOf overflows computing size/offset, panic
+ 2022-06-14 e1e66a03a6 cmd/compile,runtime,reflect: move embedded bit from offset to name
+ 2022-06-14 cb9bf93078 cmd/go: quote package directory when calling glob
+ 2022-06-14 cad477c922 cpu: fix typos in test case
+ 2022-06-13 c29be2d41c runtime: add HACKING section on nosplit functions
+ 2022-06-13 c5be77b687 doc/go1.19: minor edits
+ 2022-06-13 56bc3098f4 sync: improve linearity test robustness
+ 2022-06-13 1fe2810f9c sync: move lock linearity test and treat it like a performance test
+ 2022-06-13 6130461149 internal/testmath: add two-sample Welch's t-test for performance tests
+ 2022-06-13 24b9039149 doc/go1.19: prefer relative links to other parts of the Go website
+ 2022-06-13 fbc75dff2f cmd/cgo: remove -fsanitize=hwaddress hardware tags
+ 2022-06-13 5ee939b819 spec: clarify behavior of map size hint for make built-in
+ 2022-06-13 4703546a29 spec: add missing optional type arguments after TypeName in syntax
+ 2022-06-13 2c52465cb3 net: avoid darwin_arm64 bug in TestDialParallelSpuriousConnection
+ 2022-06-13 9228d7d7d5 doc/go1.19: add a release note for module indexing
+ 2022-06-13 7eeec1f6e4 cmd/compile: fix missing dict pass for type assertions
+ 2022-06-13 d27128b065 doc/go1.19: fix crypto tags
+ 2022-06-10 55590f3a2b net/http: doc: update RFC reference for appropriate HTTP codes
+ 2022-06-10 ff3db8d12d doc: fix typos in Go memory model
+ 2022-06-10 fb75c2da91 cmd/dist, cmd/internal/metadata: don't install metadata binary
+ 2022-06-10 386245b68e runtime: fix stack split at bad time when fuzzing
+ 2022-06-09 2cfbef4380 cmd/cgo: recognize clang 14 DWARF type names
+ 2022-06-09 c7ccabf3fe runtime/cgo: retry _beginthread on EACCES
+ 2022-06-09 91019cc13d runtime/cgo: merge bodies of cgo_sys_thread_start on windows
+ 2022-06-09 840e99ed74 api: promote next to go1.19
+ 2022-06-09 1a2ca95ad2 go/types, types2: only set instance context if packages match
+ 2022-06-08 b51d44c6dd cmd/go/testdata/script: fix skip on list_replace_absolute_windows
+ 2022-06-08 80f86f706d api/next: minor reformat
+ 2022-06-08 13f6be2833 runtime: use pidleget for faketime jump
+ 2022-06-08 1292176bc9 cmd/go: clean paths before using them form index functions
+ 2022-06-08 1858ea5d85 syscall: remove unused setgroups on linux/loong64
+ 2022-06-08 bdde41e3ba runtime: skip TestGdbBacktrace on gdb bug
+ 2022-06-08 432158b69a net: fix testHookDialTCP race
+ 2022-06-08 899f0a29c7 cmd/go: enable module index by default
+ 2022-06-08 f862280e30 cmd/go: properly call PackageModuleRoot to get modroot for index
+ 2022-06-08 d65166024f cmd/go: set Root and target fields for packages in GOPATH
+ 2022-06-08 4afb0b9e53 doc/go1.19: delete remaining TODOs
+ 2022-06-08 3426b7201d runtime: gofmt
+ 2022-06-08 f330a3a987 doc/go1.19: complete most remaining TODOs
+ 2022-06-08 2882786bf4 runtime: remove unused pipe and setNonblock on linux/loong64
+ 2022-06-08 decdd87bea doc/go1.19: mention riscv64 supported regabi
+ 2022-06-07 b72a6a7b86 os: document that Chdir affects fs.FS returned by DirFS with a relative path
+ 2022-06-07 30b929b1ef syscall: remove unused accept on linux/loong64
+ 2022-06-07 a7551fe245 net: use synthetic network in TestDialParallel
+ 2022-06-07 19d71acd97 doc/go1.19: document that the assembler requires -p
+ 2022-06-07 d151134851 doc/go1.19: document linker CL that switches DWARF compressed section format
+ 2022-06-07 3507805bcd go/types, types2: better error message for invalid use of constraint type
+ 2022-06-07 269bf7e855 go/types, types2: better error message if type is not in type set
+ 2022-06-07 d4fb93be87 go/types, types2: use | rather than ∪ when printing term lists
+ 2022-06-07 346698eea7 doc/go1.19: add release notes for net/http and net/url
+ 2022-06-07 7a82c6859f doc/go1.19: adjust runtime release notes
+ 2022-06-07 f3e051a184 runtime: document GOMEMLIMIT in environment variables section
+ 2022-06-07 ef2567c7dd doc/go1.19: document loong64 port
+ 2022-06-07 69bb7c6ef5 sync/atomic: clarify that 8-byte alignment of variables is due to escape
+ 2022-06-07 81033fbd8e doc/go1.19: some platforms are still on TSAN v2
+ 2022-06-07 0c3a0543c2 doc/go1.19: compiler section is complete, modulo TODOs
+ 2022-06-07 835a946137 doc/go1.19: minor edits
+ 2022-06-07 429a4041eb doc/go1.19: complete TODOs for go/types
+ 2022-06-07 d2630aa4b2 doc/go1.19: add various crypto release notes
+ 2022-06-07 77d9252ddf runtime: fix inline assembly trampoline for arm64
+ 2022-06-07 38607c5538 cmd/link: specify -Wl,-z params as documented
+ 2022-06-07 95b68e1e02 doc/go1.19: delete boringcrypto TODO
+ 2022-06-07 a79623b019 doc/go1.19: add more TODOs from updated relnote
+ 2022-06-06 acfff42802 doc/go1.19: add release notes for the soft memory limit and idle GC
+ 2022-06-06 a71ca3dfbd runtime, sync, sync/atomic: document happens-before guarantees
+ 2022-06-06 3651a6117e go/doc/comment: add heuristics for common badly formatted comments
+ 2022-06-06 4c08260c51 doc/go_mem: update revision date
+ 2022-06-06 7271a0a287 doc/go1.19: gc requires -p=importpath
+ 2022-06-06 c1e2ecbaf9 doc/go1.19: document Resolver.PreferGo
+ 2022-06-06 11195c60e6 cmd/go: use index to match packages in dependency modules
+ 2022-06-06 ea5d7cbc26 all: boringcrypto post-merge cleanup
+ 2022-06-06 6c7b223c2b go/doc/comment: do not turn ``` into “`
+ 2022-06-06 ce757e94e0 go/doc/comment: add doc comment
+ 2022-06-06 95547aee8c cmd/compile: cast riscv64 rewrite shifts to unsigned int
+ 2022-06-06 d43ddc1f3f strconv: fix typo in atof.go
+ 2022-06-06 2fa45a4fcd cmd/link/internal/loadpe: handle _main reference properly
+ 2022-06-06 fc97075949 go/types, types2: simplify implementation of validType (fix TODO)
+ 2022-06-06 07eca49055 go/types, types2: use type nest to detect type cycles (fix validType)
+ 2022-06-06 770146d5a8 doc/go1.19: add TODOs for changes to go/types
+ 2022-06-06 1b8ca75eaa runtime: fix breakpoint in ppc64x
+ 2022-06-06 9ce28b518d text/template/parse: fix data race on lexer initialization
+ 2022-06-06 47e34ca533 go/types, types2: ensure that named types never expand infinitely
+ 2022-06-06 02e69cfa96 go/types, types2: store Named instance information separately
+ 2022-06-06 1323b0e8f0 go/types, types2: eliminate methodList in favor of just using Named.mu
+ 2022-06-06 846f971daa go/types, types2: remove Named.once in favor of monotonic state
+ 2022-06-06 66cbf67345 cmd/buildid: reject rewriting legacy buildids
+ 2022-06-04 47f806ce81 strconv: clarify ParseFloat accepts Go syntax for float literals
+ 2022-06-04 2730c6af9f runtime: fix typo in libfuzzer_arm64.s
+ 2022-06-04 a32a592c8c database/sql/driver: fix typo in driver.go
+ 2022-06-04 0293c51bc5 regexp: avoid copying each instruction executed
+ 2022-06-04 865911424d doc: update Go memory model
+ 2022-06-04 fc66cae490 doc/go1.19: remove TODO about LimitedReader
+ 2022-06-04 f8a53df314 io: revert: add an Err field to LimitedReader
+ 2022-06-04 21f05284c7 cmd/go: index standard library packages

Change-Id: Ia7595c77a555fd2a0e7bb3b6b2cfbb745bd4947b

2 years agocmd/go: pass GOEXPERIMENT through to subtests
Russ Cox [Thu, 16 Jun 2022 19:43:57 +0000 (15:43 -0400)]
cmd/go: pass GOEXPERIMENT through to subtests

This fixes:

export GOEXPERIMENT=unified
go install cmd
go install std cmd
go install std cmd
go test -short cmd/go -run=TestScript/test_relative_import_dash_i

That script test checks that runtime is non-stale, but whether it's stale
depends on the setting of GOEXPERIMENT. Stop filtering that variable out.

Change-Id: I71bdbca495c16981cdcddf4ab4d87a38ca72a389
Reviewed-on: https://go-review.googlesource.com/c/go/+/412874
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>

2 years agoexpvar: don't crash if map value set to nil
Ian Lance Taylor [Sat, 28 May 2022 14:51:56 +0000 (07:51 -0700)]
expvar: don't crash if map value set to nil

Fixes #52719

Change-Id: Ib032193d00664090c47ae92e7d59674ec2d0165a
Reviewed-on: https://go-review.googlesource.com/c/go/+/408677
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2 years agogo/parser: remove unused method checkBinaryExpr
Robert Griesemer [Thu, 16 Jun 2022 18:10:54 +0000 (11:10 -0700)]
go/parser: remove unused method checkBinaryExpr

Change-Id: Ica981657e50e30cbfa1757e8457819a479f11c7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/412775
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2 years agocmd/go: parallelize matchPackages work in each module
Michael Matloob [Wed, 4 May 2022 21:11:35 +0000 (17:11 -0400)]
cmd/go: parallelize matchPackages work in each module

In each module matchPackages looks in, when doing the walk, do the
scanDir call in a par.Queue so all the read work can be done in
parallel.

Change-Id: I27153dbb3a2ed417ca24972f47134e9e914a55d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/404097
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2 years agocmd/link: consider alignment in carrier symbol size calculation
Cherry Mui [Thu, 16 Jun 2022 15:35:40 +0000 (11:35 -0400)]
cmd/link: consider alignment in carrier symbol size calculation

Currently, when we calculate the size of a carrier symbol, we use
the previous symbol's end address as the start. But the symbol
actually starts after applying the alignment. Do this in the
size calculation.

Should fix AIX build.

Updates #53372.

Change-Id: I17942b1fe8027dce12b78c8e8c80ea6cebcee240
Reviewed-on: https://go-review.googlesource.com/c/go/+/412734
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2 years agospec: adjust incorrect sentence in section on rune literals
Robert Griesemer [Wed, 15 Jun 2022 05:08:31 +0000 (22:08 -0700)]
spec: adjust incorrect sentence in section on rune literals

Add an additional example.

Fixes #53217.

Change-Id: I899376b9c1fa8dc5d475d8d3d6c8788ab79b0847
Reviewed-on: https://go-review.googlesource.com/c/go/+/412238
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 years agotest: add test that gofrontend fails
Ian Lance Taylor [Wed, 15 Jun 2022 22:42:47 +0000 (15:42 -0700)]
test: add test that gofrontend fails

For #52870

Change-Id: Ic0791af4283c9e426f7cbfab0514517ff84cfa80
Reviewed-on: https://go-review.googlesource.com/c/go/+/412535
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

2 years agointernal/goarch, internal/goos: update generators for syslist.go
Ian Lance Taylor [Wed, 8 Jun 2022 23:33:45 +0000 (16:33 -0700)]
internal/goarch, internal/goos: update generators for syslist.go

Update the generator programs for the changes to syslist.go in CL
390274 and the changes to the generated files in CL 344955.

Tested by running the programs and verifying that the files did not
change.

Fixes #53299

Change-Id: I2b2c5769f7e9283aa05c803256d2ea1eb9ad1547
Reviewed-on: https://go-review.googlesource.com/c/go/+/411334
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agoreflect: fix reference comment to runtime/map.go
Koichi Shiraishi [Thu, 26 May 2022 20:49:07 +0000 (05:49 +0900)]
reflect: fix reference comment to runtime/map.go

Change-Id: Icb552dc7106afbf6bd4bd3660d632f174153f834
Reviewed-on: https://go-review.googlesource.com/c/go/+/408914
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

2 years ago[dev.unified] test: extract different inline test between unified and non-unified
Cuong Manh Le [Tue, 14 Jun 2022 02:04:55 +0000 (09:04 +0700)]
[dev.unified] test: extract different inline test between unified and non-unified

Unified IR records the inline nodes position right at the position of
the inline call, while the old inliner always records at the position of
the original nodes.

We want to keep non-unified working up through go 1.20, thus this CL
extract the inline test case that is different in Unified IR and the old
inliner.

Updates #53058

Change-Id: I14b0ee99fe797d34f27cfec068982790c64ac263
Reviewed-on: https://go-review.googlesource.com/c/go/+/411935
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2 years agosyscall: clarify Pdeathsig documentation on Linux
Vojtěch Boček [Wed, 15 Jun 2022 09:36:27 +0000 (09:36 +0000)]
syscall: clarify Pdeathsig documentation on Linux

This is a rather large footgun, so let's mention that it sends the signal on thread termination and not process termination in the documentation.

Updates #27505

Change-Id: I489cf7136e34a1a7896067ae24187b0d523d987e
GitHub-Last-Rev: c8722b25d1fb8b0b3696257ec7e955eb421f15a6
GitHub-Pull-Request: golang/go#53365
Reviewed-on: https://go-review.googlesource.com/c/go/+/412114
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 years agogo/types, types2: add test case for issue for coverage
Robert Griesemer [Wed, 15 Jun 2022 02:01:04 +0000 (19:01 -0700)]
go/types, types2: add test case for issue for coverage

The specific error doesn't occur anymore.
Add a test to prevent regressions.

For #50729.

Change-Id: Ibf6ef6009b3d226b4f345b5a5657939915f19633
Reviewed-on: https://go-review.googlesource.com/c/go/+/412235
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 years agodoc/go1.19: use matching closing tag in unix build constraint heading
Tobias Klauser [Wed, 15 Jun 2022 12:40:13 +0000 (14:40 +0200)]
doc/go1.19: use matching closing tag in unix build constraint heading

Change-Id: Idb990eac60e334a5901b2d6cdc2380225d011dd6
Reviewed-on: https://go-review.googlesource.com/c/go/+/412294
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 years agosyscall, runtime/internal/syscall: always zero the higher bits of return value on...
Guoqi Chen [Fri, 10 Jun 2022 11:08:14 +0000 (19:08 +0800)]
syscall, runtime/internal/syscall: always zero the higher bits of return value on linux/loong64

All loong64 syscalls return values only via R4/A0, and R5/A1 may contain unrelated
content. Always zero the second return value.

Change-Id: I62af59369bece5bd8028b937c74f4694150f7a55
Reviewed-on: https://go-review.googlesource.com/c/go/+/411615
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2 years agonet/netip: add missing ) in ParsePrefix errors
subham sarkar [Wed, 8 Jun 2022 09:38:33 +0000 (15:08 +0530)]
net/netip: add missing ) in ParsePrefix errors

The existing error messages didn't add right parenthesis ')' properly
leading to improper formation of error messages.

Fixes #53283

Change-Id: Iadf9b8059403efa07e39716a81fab68cd10b7f87
Reviewed-on: https://go-review.googlesource.com/c/go/+/411015
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
2 years agocmd/link: set alignment for carrier symbols
Cherry Mui [Tue, 14 Jun 2022 20:47:57 +0000 (16:47 -0400)]
cmd/link: set alignment for carrier symbols

For carrier symbols like type.*, currently we don't set its
alignment. Normally it doesn't actually matter as we still align
the inner symbols. But in some cases it does make the symbol table
a bit weird, e.g. on darwin/arm64,

0000000000070000 s _runtime.types
0000000000070001 s _type.*

The address of the symbol _type.* is a bit weird. And the new
darwin linker from Xcode 14 beta doesn't like that (see issue
53372).

This CL aligns them.

Fixes #53372.

Change-Id: I1cb19dcf172e9a6bca248d85a7e54da76cbbc8a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/411912
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agocmd/go/internal/modindex: disable indexing for modules outside GOROOT and the module...
Bryan C. Mills [Wed, 15 Jun 2022 15:50:27 +0000 (11:50 -0400)]
cmd/go/internal/modindex: disable indexing for modules outside GOROOT and the module cache

Since CL 410821 we were indexing these modules with a cache key based
on the mtimes of the files within the module. However, that seems to
be causing test failures (#53269 and maybe #53371).

In addition, indexing these modules caused a potentially-expensive
operation (re-indexing a whole module) whenever any individual file
within the module is changed, even if it isn't relevant to the
package(s) being loaded from that module. In some cases, that could
cause a significant performance regression for 'go' commands invoked
on a small subset of the packages in the module (such as running 'go
test' on a single changed package — a common case during development).

Instead, we now index only those modules found within the module cache
and within GOROOT.

In addition, we now check mtimes when indexing GOROOT modules if the
Go version begins with the string "devel ", which indicates a
non-released Go version that may include local file edits within GOROOT.

For #53371.
For #53269.

Change-Id: Id3aa81b55ecfc478e47dd420148d39d2cf476f2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/412394
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>

2 years agotest: add tests for string/[]byte/[]rune conversions
Robert Griesemer [Tue, 14 Jun 2022 05:15:25 +0000 (22:15 -0700)]
test: add tests for string/[]byte/[]rune conversions

Matches examples in spec section on string conversions.

For #23814.

Change-Id: I08099c27bfdb98735868266f5a42901321b97b56
Reviewed-on: https://go-review.googlesource.com/c/go/+/412095
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>

2 years agonet: avoid infinite recursion in Windows Resolver.lookupTXT
Ian Lance Taylor [Tue, 14 Jun 2022 22:53:59 +0000 (15:53 -0700)]
net: avoid infinite recursion in Windows Resolver.lookupTXT

For #33097

Change-Id: I6138dc844f0b29b01c78a02efc1e1b1ad719b803
Reviewed-on: https://go-review.googlesource.com/c/go/+/412139
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

2 years agospec: clarify "slice of bytes" and "slice of runes" through examples
Robert Griesemer [Tue, 14 Jun 2022 01:44:44 +0000 (18:44 -0700)]
spec: clarify "slice of bytes" and "slice of runes" through examples

The spec section on conversions uses the terms "slice of bytes" and
"slice of runes". While not obviously clear, what is meant are slice
types whose element types are byte or rune types; specifically the
underlying types of the slices' element types must be byte or rune.

Some of this was evident from the examples, but not all of it. Made
this clearer by adding more examples illustrating various permitted
conversions.

Note that the 1.17 compiler did not accept the following conversions:

        string([]myByte{...})
        string([]myRune{...})
        myString([]myByte{...})
        myString([]myRune{...})

(where myByte, myRune, and myString have underlying types of byte,
rune, and string respectively) - it reported an internal error.
But it did accept the inverse conversions:

        []myByte("...")
        []myRune("...")
        []myByte(myString("..."))
        []myRune(myString("..."))

The 1.18 compiler made those conversions symmetric and they are now
permitted in both directions.

The extra examples reflect this reality.

Fixes #23814.

Change-Id: I5a1c200b45ddd0e8c0dc0d11da3a6c39cb2dc848
Reviewed-on: https://go-review.googlesource.com/c/go/+/412094
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2 years agoreflect: when StructOf overflows computing size/offset, panic
Keith Randall [Tue, 14 Jun 2022 21:38:56 +0000 (14:38 -0700)]
reflect: when StructOf overflows computing size/offset, panic

Fixes #52740

Change-Id: I849e585deb77cfcfc1b517be4a171eb29b30c5f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/412214
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
2 years agocmd/compile,runtime,reflect: move embedded bit from offset to name
Keith Randall [Tue, 14 Jun 2022 20:38:02 +0000 (13:38 -0700)]
cmd/compile,runtime,reflect: move embedded bit from offset to name

Previously we stole a bit from the field offset to encode whether
a struct field was embedded.

Instead, encode that bit in the name field, where we already have
some unused bits to play with. The bit associates naturally with
the name in any case.

This leaves a full uintptr to specify field offsets. This will make
the fix for #52740 cleaner.

Change-Id: I0bfb85564dc26e8c18101bc8b432f332176d7836
Reviewed-on: https://go-review.googlesource.com/c/go/+/412138
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2 years ago[dev.unified] cmd/compile: more Unified IR docs and review
Matthew Dempsky [Tue, 24 May 2022 17:24:05 +0000 (10:24 -0700)]
[dev.unified] cmd/compile: more Unified IR docs and review

This adds more documentation throughout the core Unified IR logic and
removes their UNREVIEWED notices.

Updates #48194.

Change-Id: Iddd30edaee1c6ea8a05a5a7e013480e02be00d29
Reviewed-on: https://go-review.googlesource.com/c/go/+/411917
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agocmd/go: quote package directory when calling glob
Ian Lance Taylor [Fri, 10 Jun 2022 22:46:43 +0000 (15:46 -0700)]
cmd/go: quote package directory when calling glob

Fixes #53314

Change-Id: I4933b59ee247daec5cf96eb15c52ff54d3ec26a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/411696
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

2 years agocpu: fix typos in test case
ag9920 [Tue, 14 Jun 2022 02:09:10 +0000 (02:09 +0000)]
cpu: fix typos in test case

Change-Id: Id6a27d0b3f3fc4181a00569bacc578e72b04ce09
GitHub-Last-Rev: 85c063d1a2d62181d16044592a60acf970fe3c86
GitHub-Pull-Request: golang/go#53359
Reviewed-on: https://go-review.googlesource.com/c/go/+/411916
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Peter Zhang <binbin36520@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

2 years agoruntime: add HACKING section on nosplit functions
Austin Clements [Mon, 18 Apr 2022 17:20:54 +0000 (13:20 -0400)]
runtime: add HACKING section on nosplit functions

Change-Id: I247874d5c49d2c0d8db2a3d227aa848093551d9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/401759
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agodoc/go1.19: minor edits
Austin Clements [Wed, 8 Jun 2022 16:06:01 +0000 (12:06 -0400)]
doc/go1.19: minor edits

For #51400

Change-Id: Ia5289dad84fb63ca6f16a40f076b5ef10511f6b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/411116
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 years agosync: improve linearity test robustness
Michael Anthony Knyszek [Fri, 10 Jun 2022 18:47:37 +0000 (18:47 +0000)]
sync: improve linearity test robustness

This change improves the robustness of the locklinear test in the
following ways:

* It removes allocations from the timing, which may be very variable if
  we're unlucky.
* It ensures that goroutines are properly cleaned up before the test
  function returns, reducing the chance that they bleed into repeat
  attempts. It also stops timing before this cleanup.

Fixes #32986.

Change-Id: I3a8096e6922f23d899ad602e2845bdfc639ed742
Reviewed-on: https://go-review.googlesource.com/c/go/+/409894
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agosync: move lock linearity test and treat it like a performance test
Michael Anthony Knyszek [Fri, 10 Jun 2022 16:21:46 +0000 (16:21 +0000)]
sync: move lock linearity test and treat it like a performance test

This change moves test/locklinear.go into the sync package tests, and
adds a bit of infrastructure since there are other linearity-checking
tests that could benefit from it too. This infrastructure is also
different than what test/locklinear.go does: instead of trying really
hard to get at least one success, we instead treat this like a
performance test and look for a significant difference via a t-test.

This makes the methodology behind the tests more rigorous, and should
reduce flakiness as transient noise should produce an insignificant
result. A follow-up CL does more to make these tests even more robust.

For #32986.

Change-Id: I408c5f643962b70ea708930edb4ac9df1c6123ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/411396
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agointernal/testmath: add two-sample Welch's t-test for performance tests
Michael Anthony Knyszek [Thu, 9 Jun 2022 20:41:18 +0000 (20:41 +0000)]
internal/testmath: add two-sample Welch's t-test for performance tests

This CL copies code from github.com/aclements/go-moremath/stats and
github.com/aclements/go-moremath/mathx for Welch's t-test. Several
existing tests in the Go repository check performance and scalability,
and this import is part of a move toward a more rigorous measurement of
both.

Note that the copied code is already licensed to Go Authors, so there's
no need to worry about additional licensing considerations.

For #32986.

Change-Id: I058630fab7216d1a589bb182b69fa2231e6f5475
Reviewed-on: https://go-review.googlesource.com/c/go/+/411395
Reviewed-by: Michael Pratt <mpratt@google.com>
2 years agodoc/go1.19: prefer relative links to other parts of the Go website
Dmitri Shuralyov [Mon, 13 Jun 2022 19:39:08 +0000 (15:39 -0400)]
doc/go1.19: prefer relative links to other parts of the Go website

The Go website can be served on more than one domain (for example,
go.dev, golang.google.cn, tip.golang.org, localhost:6060, and so on).
Use relative links which work in all contexts.

For #51400.
Updates #53337.

Change-Id: I100938981447537ac242b4045929f6db8a2674c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/411974
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2 years agocmd/cgo: remove -fsanitize=hwaddress hardware tags
Ian Lance Taylor [Fri, 10 Jun 2022 23:49:51 +0000 (16:49 -0700)]
cmd/cgo: remove -fsanitize=hwaddress hardware tags

No test because this isn't support on any of the builders.

Fixes #53285

Change-Id: If8d17bdcdac81a6ce404a35a289bf83f07f02855
Reviewed-on: https://go-review.googlesource.com/c/go/+/411698
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agospec: clarify behavior of map size hint for make built-in
Robert Griesemer [Mon, 13 Jun 2022 18:06:55 +0000 (11:06 -0700)]
spec: clarify behavior of map size hint for make built-in

The spec already states that the precise behavior of the map size
hint provided to the make built-in is implementation-dependent.

Exclude requiring specific run-time behavior for maps.
(The current Go compiler does not panic if the size hint is negative
at run-time.)

Fixes #53219.

Change-Id: I2f3618bf9ba4ed921e18dc4f2273eaa770805bd7
Reviewed-on: https://go-review.googlesource.com/c/go/+/411919
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2 years agospec: add missing optional type arguments after TypeName in syntax
Robert Griesemer [Mon, 13 Jun 2022 17:18:38 +0000 (10:18 -0700)]
spec: add missing optional type arguments after TypeName in syntax

Types may be generic, so each occurrence of a TypeName may be
followed by optional type arguments. Add the missing syntactic
(EBNF) factor.

The syntax of type names followed by type arguments matches the
syntax of operand names followed by type arguments (operands may
also be types, or generic functions, among other things). This
opens the door to factoring out this shared syntax, but it will
also require some adjustments to prose to make it work well.
Leaving for another change.

Fixes #53240.

Change-Id: I15212225c28b27f7621e3ca80dfbd131f6b7eada
Reviewed-on: https://go-review.googlesource.com/c/go/+/411918
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
2 years agonet: avoid darwin_arm64 bug in TestDialParallelSpuriousConnection
Damien Neil [Wed, 8 Jun 2022 18:53:22 +0000 (11:53 -0700)]
net: avoid darwin_arm64 bug in TestDialParallelSpuriousConnection

On darwin_arm64, reading from a socket at the same time as the other
end is closing it will occasionally hang for 60 seconds before
returning ECONNRESET. (This is a macOS issue, not a Go issue.)

Work around this condition by adding a brief sleep before the read.

Fixes #37795.

Change-Id: I63f92b91fb297cd66f89cdab707583afd50ab9c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/411155
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Damien Neil <dneil@google.com>

2 years agodoc/go1.19: add a release note for module indexing
Michael Matloob [Thu, 9 Jun 2022 19:11:57 +0000 (15:11 -0400)]
doc/go1.19: add a release note for module indexing

Change-Id: I264499d955049c5b7c4bdda7ce23cf7fe7031402
Reviewed-on: https://go-review.googlesource.com/c/go/+/411497
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2 years agocmd/compile: fix missing dict pass for type assertions
Cuong Manh Le [Fri, 10 Jun 2022 18:33:11 +0000 (01:33 +0700)]
cmd/compile: fix missing dict pass for type assertions

For type assertions, if either src or dst type has shape, we must
convert them to dynamic type assertions.

Fixes #53309

Change-Id: Ia3362fa67c011febcbdb5b26f856d081b5c366de
Reviewed-on: https://go-review.googlesource.com/c/go/+/411617
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2 years agodoc/go1.19: fix crypto tags
Roland Shoemaker [Fri, 10 Jun 2022 20:21:14 +0000 (13:21 -0700)]
doc/go1.19: fix crypto tags

Closes an unclosed <code> tag, and tags a type that was untagged.

Change-Id: I9a1efda07f783f0ca7a93ffefbda4e29f5fc8d41
Reviewed-on: https://go-review.googlesource.com/c/go/+/411694
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>

2 years agonet/http: doc: update RFC reference for appropriate HTTP codes
Louis PORTAY [Thu, 9 Jun 2022 23:29:35 +0000 (23:29 +0000)]
net/http: doc: update RFC reference for appropriate HTTP codes

This documentation commit points to the latest RFC documenting HTTP codes

Change-Id: Ia7640664637f0c7846e2182353b787474bac7b4f
GitHub-Last-Rev: 5fb544ee32e1f16c871b08d9ff0a3cc6819418cd
GitHub-Pull-Request: golang/go#53318
Reviewed-on: https://go-review.googlesource.com/c/go/+/411475
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

2 years agodoc: fix typos in Go memory model
Dominik Honnef [Fri, 10 Jun 2022 21:13:41 +0000 (23:13 +0200)]
doc: fix typos in Go memory model

Change-Id: I8e94215d9bee0ea3ad378870fe565e961a9d80c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/411595
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2 years ago[dev.unified] test: add regress tests for #53276 and #53328
Matthew Dempsky [Fri, 10 Jun 2022 20:24:33 +0000 (13:24 -0700)]
[dev.unified] test: add regress tests for #53276 and #53328

These two tests fail with the 1.18 compiler frontend, because of
incomplete dictionary support. This CL adds the tests for Unified IR,
which currently handles them correctly, to make sure it doesn't repeat
the same errors.

Updates #53276.
Updates #53328.

Change-Id: I9f436495d28f2bc5707a17bd2527c86abacf91f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/411695
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>