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

53289 Commits

Author SHA1 Message Date
hopehook
91d5ce3def all: clean up TODO after fixing issue 44505
For #44505

Change-Id: I89220be02372b5340cb987bf2ac870a9346a8c8f
Reviewed-on: https://go-review.googlesource.com/c/go/+/421079
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-04 20:35:21 +00:00
Matthew Dempsky
39728f412d go/internal/gcimporter: rewrite interface receiver parameters
For a type definition like `type I interface{ M() }`, the go/types API
traditionally sets `M`'s receiver parameter type to `I`, whereas
Unified IR was (intentionally) leaving it as `interface{ M() }`.

I still think `interface{ M() }` is the more consistent and
semantically correct type to use in this scenario, but I concede that
users want `I` instead, as evidenced by existing tooling and tests.

Updates #49906.

Change-Id: I74ba5e8b08e4e98ed9dc49f72b7834d5b552058b
Reviewed-on: https://go-review.googlesource.com/c/go/+/421355
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
2022-08-04 18:27:30 +00:00
Matthew Dempsky
a10afb15e0 all: REVERSE MERGE dev.unified (d558507) into master
This commit is a REVERSE MERGE.
It merges dev.unified back into its parent branch, master.
This marks the end of development on dev.unified.

Merge List:

+ 2022-08-04 d558507db4 [dev.unified] all: merge master (85d87b9) into dev.unified
+ 2022-08-03 c9f2150cfb [dev.unified] cmd/compile: start using runtime dictionaries
+ 2022-07-30 994ff78ba0 [dev.unified] go/internal: set underlying types in proper order
+ 2022-07-28 23554d4744 [dev.unified] all: merge master (462b78f) into dev.unified
+ 2022-07-28 c8d5ccf82e [dev.unified] go/internal/gcimporter: flatten imports
+ 2022-07-28 ac0844ec27 [dev.unified] cmd/compile: move "has init" to private metadata
+ 2022-07-28 f995946094 [dev.unified] cmd/compile: implement simple inline body pruning heuristic
+ 2022-07-28 f2851c67fd [dev.unified] cmd/compile: allow inlining to fail gracefully
+ 2022-07-28 831fdf1dff [dev.unified] cmd/compile: extract nil handling from exprType
+ 2022-07-28 92798176e7 [dev.unified] cmd/compile: write iface conversion RTTI into unified IR
+ 2022-07-28 9b70178d58 [dev.unified] cmd/compile: write RTTI into unified IR export data
+ 2022-07-25 fc72b7705d [dev.unified] cmd/compile: add method expressions to dictionaries
+ 2022-07-25 f48fa643f1 [dev.unified] cmd/compile: remove obsolete RTTI wiring
+ 2022-07-22 131f981df0 [dev.unified] cmd/compile: make Unified IR always writes concrete type for const exprs
+ 2022-07-20 ae43bdc3e3 Merge "[dev.unified] all: merge master (8e1e64c) into dev.unified" into dev.unified
+ 2022-07-19 7a8ba83b72 [dev.unified] cmd/compile/internal/reflectdata: remove hasRType's `required` param
+ 2022-07-19 64cd6faa13 [dev.unified] cmd/compile/internal/noder: simplify mixed tag/case RTTI wiring
+ 2022-07-19 a4c5198a3c [dev.unified] cmd/compile/internal/noder: better switch statements
+ 2022-07-19 318027044a [dev.unified] cmd/compile/internal/noder: explicit nil handling
+ 2022-07-19 e971b6a9be [dev.unified] test: add switch test case for tricky nil handling
+ 2022-07-19 878439cfe5 [dev.unified] cmd/compile/internal/noder: preserve RTTI for select statements
+ 2022-07-19 e376746e54 [dev.unified] cmd/compile/internal/noder: wire RTTI for implicit conversions
+ 2022-07-19 c846fd8e13 [dev.unified] cmd/compile/internal/noder: implicit conversions for binary exprs
+ 2022-07-19 ebd34e3e45 [dev.unified] test: relax panic message expectations
+ 2022-07-19 76a82f09d6 [dev.unified] cmd/compile/internal/noder: prefer *At functions
+ 2022-07-19 de649a2a98 [dev.unified] all: merge master (8e1e64c) into dev.unified
+ 2022-07-19 055a5e55fa [dev.unified] test: change Unicode file/package name to use characters not translated by macOS.
+ 2022-07-18 2cf632cd57 [dev.unified] cmd/compile/internal/reflectdata: prefer ITabAddrAt in ConvIfaceTypeWord
+ 2022-07-12 9371a65584 internal/pkgbits: change EnableSync into a dynamic knob
+ 2022-07-01 d667be8831 [dev.unified] cmd/compile/internal/walk: RType fields for range assignments
+ 2022-06-30 1b838e9556 [dev.unified] all: merge master (993c387) into dev.unified
+ 2022-06-30 0a503cf43a [dev.unified] cmd/compile: refactor `range` desugaring
+ 2022-06-30 3635b07d16 [dev.unified] cmd/compile/internal/noder: implicit conversions for multi-valued expressions
+ 2022-06-30 e7219cc093 [dev.unified] cmd/compile/internal/noder: refactor N:1 expression handling
+ 2022-06-30 2f3ef73e18 [dev.unified] test: tweak nilcheck test
+ 2022-06-30 95d7ce9ab1 [dev.unified] test: break escape_iface.go into unified/nounified variants
+ 2022-06-30 f751319a0b [dev.unified] test: relax live_regabi.go
+ 2022-06-30 e3cdc981c8 [dev.unified] cmd/compile/internal/walk: fix typo in debug print
+ 2022-06-29 2280d897d6 [dev.unified] test: add regress test for generic select statements
+ 2022-06-27 4b78ece3d7 [dev.unified] cmd/compile: drop package height from Unified IR importer
+ 2022-06-27 398d46d538 [dev.unified] cmd/compile/internal/types2: remove package height
+ 2022-06-24 e7100adbca [dev.unified] all: merge master (5a1c5b8) into dev.unified
+ 2022-06-23 09a838ad86 [dev.unified] cmd/compile: rename haveRType and implicitExpr
+ 2022-06-23 421e9e9db2 [dev.unified] cmd/compile: implicit conversions for return statements
+ 2022-06-23 a3fea7796a [dev.unified] cmd/compile/internal/noder: implicit conversions for writer.assignStmt
+ 2022-06-23 82a958a661 [dev.unified] cmd/compile/internal/noder: refactor stmtAssign generation
+ 2022-06-23 711dacd8cf [dev.unified] cmd/compile/internal/noder: implicit conversion of call arguments
+ 2022-06-23 46b01ec667 [dev.unified] cmd/compile/internal/noder: remove needType logic
+ 2022-06-23 a3e474f867 [dev.unified] cmd/compile/internal/noder: implicit conversions for complits
+ 2022-06-23 5f5422a2dd [dev.unified] cmd/compile/internal/noder: start writing implicit conversions
+ 2022-06-23 9cb784ac69 [dev.unified] cmd/compile/internal/noder: add pkgWriter.typeOf helper
+ 2022-06-23 c70e93ff3d [dev.unified] cmd/compile/internal/typecheck: replace unreachable code with assert
+ 2022-06-23 20e1d5ac8c [dev.unified] cmd/compile: special case f(g()) calls in Unified IR
+ 2022-06-23 61ae2b734c [dev.unified] cmd/compile: plumb rtype through OSWITCH/OCASE clauses
+ 2022-06-23 3d432b6c4b [dev.unified] cmd/compile: plumb rtype through for OMAPLIT
+ 2022-06-23 7368647ac6 [dev.unified] cmd/compile: start setting RType fields for Unified IR
+ 2022-06-23 5960f4ec10 [dev.unified] cmd/compile: add RType fields
+ 2022-06-21 5e0258c700 [dev.unified] cmd/compile: avoid reflectType in ssagen
+ 2022-06-21 93833cd5d8 [dev.unified] cmd/compile: extract rtype code from walk
+ 2022-06-21 f70775ff22 [dev.unified] cmd/compile: refactor reflectdata.{TypePtr,ITabAddr}
+ 2022-06-21 fc5dad6646 [dev.unified] cmd/compile/internal/walk: minor prep refactoring
+ 2022-06-16 1f4e8afafe [dev.unified] all: merge master (635b124) into dev.unified
+ 2022-06-15 8a9485c023 [dev.unified] test: extract different inline test between unified and non-unified
+ 2022-06-14 394ea70cc9 [dev.unified] cmd/compile: more Unified IR docs and review
+ 2022-06-10 f73ad3d24d [dev.unified] test: add regress tests for #53276 and #53328
+ 2022-06-09 8ef8b60e18 [dev.unified] cmd/compile/internal/noder: stop handling type expressions as expressions
+ 2022-06-09 1a6c96bb9b [dev.unified] test: relax issue7921.go diagnostic message
+ 2022-06-09 c50c6bbc03 [dev.unified] cmd/compile: set base.Pos when process assignDef in Unified IR
+ 2022-06-09 d6df08693c [dev.unified] cmd/compile: fix unified IR don't report type size too large error
+ 2022-06-08 e7ef58542c [dev.unified] cmd/compile: restore Unified IR linkname pragma diagnostic
+ 2022-06-07 9e5c968021 [dev.unified] cmd/compile: visit LHS before RHS/X in assign/for statement
+ 2022-06-06 46ddf0873e [dev.unified] cmd/compile: export/import implicit attribute for conversion exprs
+ 2022-06-06 a8780f94c3 [dev.unified] cmd/compile: fix missing method value wrapper in unified IR
+ 2022-06-06 3a1f1e1575 [dev.unified] cmd/compile: remove package height
+ 2022-06-06 df7cb59de4 [dev.unified] cmd/compile: only sort symbols by name and package path
+ 2022-06-06 b39ac80871 [dev.unified] cmd/compile/internal/noder: push exprBlank up into assignment handling
+ 2022-06-06 55fc07e164 [dev.unified] cmd/compile/internal/noder: add optExpr for optional expressions
+ 2022-06-06 6c33f1d52e [dev.unified] cmd/compile/internal/noder: rename exprName to exprGlobal
+ 2022-06-06 4d28fcabb4 [dev.unified] all: update codereview.cfg for dev.unified branch

Change-Id: I604d057735e8a365621c91c206f9e46eabb4679b
2022-08-04 10:32:51 -07:00
Matthew Dempsky
d558507db4 [dev.unified] all: merge master (85d87b9) into dev.unified
Merge List:

+ 2022-08-04 85d87b9c75 all: update vendored golang.org/x dependencies for Go 1.20 development
+ 2022-08-04 fb1bfd4d37 all: remove pre-Go 1.17 workarounds
+ 2022-08-04 44ff9bff0c runtime: clean up panic and deadlock lock ranks
+ 2022-08-04 f42dc0de74 runtime: make the lock rank DAG make more sense
+ 2022-08-04 d29a0282e9 runtime: add mayAcquire annotation for finlock
+ 2022-08-04 c5be4ed7df runtime: add missing trace lock edges
+ 2022-08-04 2b8a9a484f runtime: generate the lock ranking from a DAG description
+ 2022-08-04 ddfd639408 runtime: delete unused lock ranks
+ 2022-08-04 426ea5702b internal/dag: add a Graph type and make node order deterministic
+ 2022-08-04 d37cc9a8cd go/build, internal/dag: lift DAG parser into an internal package
+ 2022-08-04 ab0a94c6d3 cmd/dist: require Go 1.17 for building Go
+ 2022-08-04 1e3c19f3fe runtime: support riscv64 SV57 mode
+ 2022-08-03 f28fa952b5 make.bat, make.rc: show bootstrap toolchain version
+ 2022-08-03 87384801dc cmd/asm: update package doc to describe "-p" option
+ 2022-08-03 c6a2dada0d net: disable TestIPv6WriteMsgUDPAddrPortTargetAddrIPVersion [sic] on DragonflyBSD
+ 2022-08-02 29b9a328d2 runtime: trivial replacements of g in remaining files
+ 2022-08-02 c647264619 runtime: trivial replacements of g in signal_unix.go
+ 2022-08-02 399f50c9d7 runtime: tricky replacements of g in traceback.go
+ 2022-08-02 4509e951ec runtime: tricky replacements of g in proc.go
+ 2022-08-02 4400238ec8 runtime: trivial replacements of _g_ in remaining files
+ 2022-08-02 5999a28de8 runtime: trivial replacements of _g_ in os files
+ 2022-08-02 0e18cf6d09 runtime: trivial replacements of _g_ in GC files
+ 2022-08-02 4358a53a97 runtime: trivial replacements of _g_ in proc.go
+ 2022-08-02 b486518964 runtime: tricky replacements of _g_ in os3_solaris.go
+ 2022-08-02 54a0ab3f7b runtime: tricky replacements of _g_ in os3_plan9.go
+ 2022-08-02 4240ff764b runtime: tricky replacements of _g_ in signal_windows.go
+ 2022-08-02 8666d89ca8 runtime: tricky replacements of _g_ in signal_unix.go
+ 2022-08-02 74cee276fe runtime: tricky replacements of _g_ in trace.go
+ 2022-08-02 222799fde6 runtime: tricky replacements of _g_ in mgc.go
+ 2022-08-02 e9d7f54a1a runtime: tricky replacements of _g_ in proc.go
+ 2022-08-02 5e8d261918 runtime: rename _p_ to pp
+ 2022-08-02 0ad2ec6596 runtime: clean up dopanic_m
+ 2022-08-02 7e952962df runtime: clean up canpanic
+ 2022-08-02 9dbc0f3556 runtime: fix outdated g.m comment in traceback.go
+ 2022-08-02 d723df76da internal/goversion: update Version to 1.20
+ 2022-08-02 1b7e71e8ae all: disable tests that fail on Alpine
+ 2022-08-01 f2a9f3e2e0 test: improve generic type assertion test
+ 2022-08-01 27038b70f8 cmd/compile: fix wrong dict pass condition for type assertions
+ 2022-08-01 e99f53fed9 doc: move Go 1.19 release notes to x/website
+ 2022-08-01 8b13a073a1 doc: mention removal of cmd/compile's -importmap and -installsuffix flags
+ 2022-08-01 e95fd4c238 doc/go1.19: fix typo: EM_LONGARCH -> EM_LOONGARCH
+ 2022-08-01 dee3efd9f8 doc/go1.19: fix a few links that were missing trailing slashes
+ 2022-07-30 f32519e5fb runtime: fix typos
+ 2022-07-29 9a2001a8cc cmd/dist: always pass -short=true with -quick
+ 2022-07-28 5c8ec89cb5 doc/go1.19: minor adjustments and links
+ 2022-07-28 417be37048 doc/go1.19: improve the loong64 release notes
+ 2022-07-28 027855e8d8 os/exec: add GODEBUG setting to opt out of ErrDot changes

Change-Id: Idc0fbe93978c0dff7600b90a2c3ecc067fd9f5f2
2022-08-04 10:12:28 -07:00
Dmitri Shuralyov
85d87b9c75 all: update vendored golang.org/x dependencies for Go 1.20 development
Go 1.20 development is just beginning. This is a time to update all
golang.org/x/... module versions that contribute packages to the std
and cmd modules in the standard library to latest master versions.

This CL holds back some of the available updates to the x/net module
due to go.dev/issue/54259. It'll be updated in a later separate pass.
x/tools is also held back a bit to avoid pulling in too new of x/net.

For #36905.
For #53812.
Updates #54259.

Change-Id: Iaefe6a343a02cc5ceb85c15125882d64dd372627
Reviewed-on: https://go-review.googlesource.com/c/go/+/421334
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-04 17:12:04 +00:00
Russ Cox
fb1bfd4d37 all: remove pre-Go 1.17 workarounds
The Go bootstrap toolchain requirement is now Go 1.17.
We can finally delete all these pre-Go 1.17 workarounds.

For #44505.

Change-Id: I59d4dff1cde23da022892b5b6a116eb3dbad9ce4
Reviewed-on: https://go-review.googlesource.com/c/go/+/420903
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 17:05:18 +00:00
Austin Clements
44ff9bff0c runtime: clean up panic and deadlock lock ranks
I'm not entirely sure why these locks are currently ranked "deadlock <
panic" since we drop panic before acquiring deadlock, and we actually
want deadlock to be below panic because panic is implicitly below
everything else and we want deadlock to be, too. My best guess is that
we had this edge because we intentionally acquire deadlock twice to
deadlock, and that causes the lock rank checking to panic on the
second acquire.

Fix this in a more sensible way by capturing that deadlock can be
acquired in a self-cycle and flipping the rank to "panic < deadlock"
to express that deadlock needs to be under all other locks, just like
panic.

For #53789.

Change-Id: I8809e5d102ce473bd3ace0ba07bf2200ef60263f
Reviewed-on: https://go-review.googlesource.com/c/go/+/418719
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Austin Clements <austin@google.com>
2022-08-04 15:31:49 +00:00
Austin Clements
f42dc0de74 runtime: make the lock rank DAG make more sense
This groups, comments, and generally reorganizes the lock rank graph
description by subsystem. It also introduces several pseudo-nodes that
more cleanly describe the inherent layering of lock ranks by
subsystem.

I believe this doesn't actually change the graph, but haven't verified
this.

For #53789.

Change-Id: I72f332f5a23b8217c7dc1b21411631ad48cee4b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/418718
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2022-08-04 15:31:48 +00:00
Austin Clements
d29a0282e9 runtime: add mayAcquire annotation for finlock
We're missing lock edges to finlock that happen only rarely. Anything
that calls mallocgc can potentially trigger sweeping, which can
potentially queue a finalizer, which acquires finlock. While this can
happen on any malloc, it happens relatively rarely, so we simply
haven't seen some of the lock edges that could happen.

Add a mayAcquire annotation to mallocgc to capture the possibility of
acquiring finlock.

With this change, we add "fin" to the set of "malloc" locks. Several
of these edges were already there, but not quite all of them.

This was found by inspecting the rank graph for things that didn't
make sense.

For #53789.

Change-Id: Idc10ce6f250596b0c07ba07ac93f2198fb38c22b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418717
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:46 +00:00
Austin Clements
c5be4ed7df runtime: add missing trace lock edges
We're missing lock edges to trace.lock that happen only rarely. Any
trace event can potentially fill up a trace buffer and acquire
trace.lock in order to flush the buffer, but this happens relatively
rarely, so we simply haven't seen some of these lock edges that could
happen.

With this change, we promote "fin, notifyList < traceStackTab" to
"fin, notifyList < trace" and now everything that emits trace events
with a P enters the tracer lock ranks via "trace", rather than some
things entering at "trace" and others at "traceStackTab".

This was found by inspecting the rank graph for things that didn't
make sense.

Ideally we would add a mayAcquire annotation that any trace event can
potentially acquire trace.lock, but there are actually cases that
violate this ranking right now. This is #53979. The chance of a lock
cycle is extremely low given the number of conditions that have to
happen simultaneously.

For #53789.

Change-Id: Ic65947d27dee88d2daf639b21b2c9d37552f0ac0
Reviewed-on: https://go-review.googlesource.com/c/go/+/418716
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:45 +00:00
Austin Clements
2b8a9a484f runtime: generate the lock ranking from a DAG description
Currently, the runtime lock rank graph is maintained manually in a
large set of arrays that give the partial order and a manual
topological sort of this partial order. Any changes to the rank graph
are difficult to reason about and hard to review, as well as likely to
cause merge conflicts. Furthermore, because the partial order is
manually maintained, it's not actually transitively closed (though
it's close), meaning there are many cases where rank a can be acquired
before b and b before c, but a cannot be acquired before c. While this
isn't technically wrong, it's very strange in the context of lock
ordering.

Replace all of this with a much more compact, readable, and
maintainable description of the rank graph written in the internal/dag
graph language. We statically generate the runtime structures from
this description, which has the advantage that the parser doesn't have
to run during runtime initialization and the structures can live in
static data where they can be accessed from any point during runtime
init.

The current description was automatically generated from the existing
partial order, combined with a transitive reduction. This ensures it's
correct, but it could use some manual messaging to call out the
logical layers and add some structure.

We do lose the ad hoc string names of the lock ranks in this
translation, which could mostly be derived from the rank constant
names, but not always. I may bring those back but in a more uniform
way.

We no longer need the tests in lockrank_test.go because they were
checking that we manually maintained the structures correctly.

Fixes #53789.

Change-Id: I54451d561b22e61150aff7e9b8602ba9737e1b9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418715
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:44 +00:00
Austin Clements
ddfd639408 runtime: delete unused lock ranks
For #53789.

Change-Id: Ic7379afcfdcc47b541bac9b44b5bc6b43604fc0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/418714
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2022-08-04 15:31:43 +00:00
Austin Clements
426ea5702b internal/dag: add a Graph type and make node order deterministic
The go/types package doesn't care about node ordering because it's
just querying paths in the graph, but we're about to use this for the
runtime lock graph, and there we want determinism.

For #53789.

Change-Id: Ic41329bf2eb9a3a202f97c21c761ea588ca551c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/418593
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
2022-08-04 15:31:42 +00:00
Austin Clements
d37cc9a8cd go/build, internal/dag: lift DAG parser into an internal package
This lifts the DAG parser from the go/build dependencies test into its
own package that can be reused elsewhere.

I tried to keep the code as close as possible. I changed some names to
reflect the more general purpose of internal/dag. Most of the changes
are related to error handling, since internal/dag doesn't take a
testing.T on which to report errors. Notably, parseRules now returns a
slice of parsed rules rather than calling a callback because this made
it easier to separate fatal parsing errors from non-fatal graph
checking errors.

For #53789.

Change-Id: I170b84fd85f971cfc1a50972156d48e78b45fce3
Reviewed-on: https://go-review.googlesource.com/c/go/+/418592
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 15:31:40 +00:00
Russ Cox
ab0a94c6d3 cmd/dist: require Go 1.17 for building Go
This makes builds using earlier Go bootstrap versions fail pretty clearly:

% GOROOT_BOOTSTRAP=$HOME/sdk/go1.16 ./make.bash
Building Go cmd/dist using /Users/rsc/sdk/go1.16. (go1.16 darwin/amd64)
found packages main (build.go) and building_Go_requires_Go_1_17_or_later (notgo117.go) in /Users/rsc/go/src/cmd/dist
%

All the builders have Go 1.17 or later for bootstrap now except
for the android corellium builders, which still need updating (#54246).
We are accepting breakage on those for now.

Fixes #44505.

Change-Id: I12a67f42f61dba43a331cee0a150194d3e42c044
Reviewed-on: https://go-review.googlesource.com/c/go/+/420902
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
2022-08-04 14:47:49 +00:00
Dmitry Vyukov
1e3c19f3fe runtime: support riscv64 SV57 mode
riscv64 has SV57 mode when user-space VA is 56 bits.
Linux kernel recently got support for this mode and Go binaries started crashing as:

runtime: lfstack.push invalid packing: node=0xffffff5908a940 cnt=0x1
packed=0xffff5908a9400001 -> node=0xffff5908a940

Adjust lfstack code to use only 8 top bits of pointers on riscv64.

For context see:
https://groups.google.com/g/syzkaller-bugs/c/lU0GQTZoNQQ/m/O_c3vmE3AAAJ

Update #54104

Change-Id: Ib5d3d6a79c0c6eddf11618d73fcc8bc1832a9c25
Reviewed-on: https://go-review.googlesource.com/c/go/+/409055
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-08-04 05:33:40 +00:00
Russ Cox
f28fa952b5 make.bat, make.rc: show bootstrap toolchain version
Print the bootstrap toolchain version on Plan 9 and Windows,
same as on all Unix systems since CL 204757 (Nov 2019).
This makes it easier to see what is going on in a build.

For #44505.

Change-Id: I50cdd5e15a7c8b908e33e92780f8a3bca65c91ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/419452
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-03 19:52:27 +00:00
Than McIntosh
87384801dc cmd/asm: update package doc to describe "-p" option
Include a description of the assembler's "-p" command line option
in the package doc.

Fixes #54215.

Change-Id: I641abad573c37aa9447af6e8b84716093c2a2b70
Reviewed-on: https://go-review.googlesource.com/c/go/+/420900
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Than McIntosh <thanm@google.com>
2022-08-03 19:25:54 +00:00
Matthew Dempsky
c9f2150cfb [dev.unified] cmd/compile: start using runtime dictionaries
This CL switches unified IR to start using runtime dictionaries,
rather than pure stenciling. In particular, for each instantiated
function `F[T]`, it now:

1. Generates a global variable `F[T]-dict` of type `[N]uintptr`, with
all of the `*runtime._type` values needed by `F[T]`.

2. Generates a function `F[T]-shaped`, with an extra
`.dict *[N]uintptr` parameter and indexing into that parameter for
derived types. (N.B., this function is not yet actually using shape
types.)

3. Changes `F[T]` to instead be a wrapper function that calls
`F[T]-shaped` passing `&F[T]-dict` as the `.dict` parameter.

This is done in one pass to make sure the overall wiring is all
working (especially, function literals and inlining).

Subsequent CLs will write more information into `F[T]-dict` and update
`F[T]-shaped` to use it instead of relying on `T`-derived information
itself. Once that's done, `F[T]-shaped` can be changed to
`F[shapify(T)]` (e.g., `F[go.shape.int]`) and deduplicated.

Change-Id: I0e802a4d9934794e01a6bfc367820af893335155
Reviewed-on: https://go-review.googlesource.com/c/go/+/420416
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-08-03 19:20:41 +00:00
Russ Cox
c6a2dada0d net: disable TestIPv6WriteMsgUDPAddrPortTargetAddrIPVersion [sic] on DragonflyBSD
Like OpenBSD, DragonflyBSD does not do IPv4-in-IPv6 mapping.

For #52264.

Change-Id: Id41606e75652e684f2e0e98c6459156641aec9b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/420775
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-03 13:50:38 +00:00
Michael Pratt
29b9a328d2 runtime: trivial replacements of g in remaining files
Rename g variables to gp for consistency.

Change-Id: I09ecdc7e8439637bc0e32f9c5f96f515e6436362
Reviewed-on: https://go-review.googlesource.com/c/go/+/418591
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:52:33 +00:00
Michael Pratt
c647264619 runtime: trivial replacements of g in signal_unix.go
Change-Id: I0d8d50c8b7ae6cd01594091392dc726cf149e34a
Reviewed-on: https://go-review.googlesource.com/c/go/+/418590
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:52:18 +00:00
Michael Pratt
399f50c9d7 runtime: tricky replacements of g in traceback.go
Change-Id: I80e847451b697de049a01df051a73b5976b39d4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/418589
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:52:13 +00:00
Michael Pratt
4509e951ec runtime: tricky replacements of g in proc.go
Change-Id: I36cd167ed77e123b3ba7dd4a1a8577cbc51a84d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/418588
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:52:08 +00:00
Michael Pratt
4400238ec8 runtime: trivial replacements of _g_ in remaining files
Change-Id: I24d299b345bda1c9d6fa7876d4f03c05b8c1156d
Reviewed-on: https://go-review.googlesource.com/c/go/+/418587
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:52:03 +00:00
Michael Pratt
5999a28de8 runtime: trivial replacements of _g_ in os files
Change-Id: I7886ea6b94697bafb8ea345508c9cb752c92cadc
Reviewed-on: https://go-review.googlesource.com/c/go/+/418586
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:51:58 +00:00
Michael Pratt
0e18cf6d09 runtime: trivial replacements of _g_ in GC files
Change-Id: Iedf10558d9a1d3b80a151927b99660b688ed9ccb
Reviewed-on: https://go-review.googlesource.com/c/go/+/418585
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:53 +00:00
Michael Pratt
4358a53a97 runtime: trivial replacements of _g_ in proc.go
Generated with global replace: 's/_g_/gp/g'.

Change-Id: Ia91606a0a8a5773be7c6e5152160510ae9bb221e
Reviewed-on: https://go-review.googlesource.com/c/go/+/418584
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:47 +00:00
Michael Pratt
b486518964 runtime: tricky replacements of _g_ in os3_solaris.go
The argument to semacreate is always getg().m.

Change-Id: I4c4104cd6b57ab6b9ed0b7d11b8089bcc9fdd621
Reviewed-on: https://go-review.googlesource.com/c/go/+/418583
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:42 +00:00
Michael Pratt
54a0ab3f7b runtime: tricky replacements of _g_ in os3_plan9.go
Change-Id: I2a3ec71a33380b1215b9ab1ceb0a9b0e2bf7835b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418582
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:38 +00:00
Michael Pratt
4240ff764b runtime: tricky replacements of _g_ in signal_windows.go
winthrow is always called on g0.

Change-Id: Ia23276a5bd545993faf4d75368c171f6ea7a3034
Reviewed-on: https://go-review.googlesource.com/c/go/+/418581
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:32 +00:00
Michael Pratt
8666d89ca8 runtime: tricky replacements of _g_ in signal_unix.go
sighandler has gp, the goroutine running when the signal arrived, and
gsignal, the goroutine executing the signal handler. The latter is
usually mp.gsignal, except in the case noted by the delayedSignal check.

Like previous CLs, cases where the getg() G is used only to access the M
are replaced with direct uses of mp.

Change-Id: I2dc7894da7004af17682712e07a0be5f9a235d81
Reviewed-on: https://go-review.googlesource.com/c/go/+/418580
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:51:27 +00:00
Michael Pratt
74cee276fe runtime: tricky replacements of _g_ in trace.go
Like previous CLs, cases where the getg() G is used only to access the M
are replaced with direct uses of mp.

Change-Id: I4740c80d6b4997d051a52afcfa8c087e0317dab3
Reviewed-on: https://go-review.googlesource.com/c/go/+/418579
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:51:22 +00:00
Michael Pratt
222799fde6 runtime: tricky replacements of _g_ in mgc.go
getg() is used primarily for gp.m, so use mp. gp.m.curg is also used,
name that curgp.

Change-Id: I9db2dc4adce2b17d6b41c60d4f2dfbc9aa41fac1
Reviewed-on: https://go-review.googlesource.com/c/go/+/418578
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:51:17 +00:00
Michael Pratt
e9d7f54a1a runtime: tricky replacements of _g_ in proc.go
This manually replaces uses of _g_ that cannot be trivially switched to
gp since there is another gp variable in scope.

Most of these functions only use the current g to reach the m, so this
helps with clarity by switching all accesses directly to an mp variable.

Change-Id: I96a4fc1c32470a7f3d12ddec9f147c2743210e71
Reviewed-on: https://go-review.googlesource.com/c/go/+/418577
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:12 +00:00
Michael Pratt
5e8d261918 runtime: rename _p_ to pp
_g_, _p_, and _m_ are primarily vestiges of the C version of the
runtime, while today we prefer Go-style variable names (generally gp,
pp, and mp).

This change replaces all remaining uses of _p_ with pp. These are all
trivial replacements (i.e., no conflicts). That said, there are several
functions that refer to two different Ps at once. There the naming
convention is generally that pp refers to the local P, and p2 refers to
the other P we are accessing.

Change-Id: I205b801be839216972e7644b1fbeacdbf2612859
Reviewed-on: https://go-review.googlesource.com/c/go/+/306674
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:06 +00:00
Michael Pratt
0ad2ec6596 runtime: clean up dopanic_m
gp is a user G running on the same M as getg(), so it is a fine proxy
for gp.m.

Change-Id: I9aa1dd283ecf28878eeedd7da4ded5c901809832
Reviewed-on: https://go-review.googlesource.com/c/go/+/418576
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-02 18:51:01 +00:00
Michael Pratt
7e952962df runtime: clean up canpanic
* The gp argument to canpanic is always equivalent to getg(), so no need
to pass it at all.
* gp must not be nil or _g_.m would have crashed, so no need to check
for nil.
* Use acquirem to better reason about preemption.

Change-Id: Ic7dc8dc1e56ab4c1644965f6aeba16807cdb2df4
Reviewed-on: https://go-review.googlesource.com/c/go/+/418575
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-02 18:50:55 +00:00
Michael Pratt
9dbc0f3556 runtime: fix outdated g.m comment in traceback.go
Change-Id: Idfd02781a9ee550da240ef53898943e8cd37dd64
Reviewed-on: https://go-review.googlesource.com/c/go/+/418574
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2022-08-02 18:50:48 +00:00
Dmitri Shuralyov
d723df76da internal/goversion: update Version to 1.20
This is the start of the Go 1.20 development cycle, so update the
Version value accordingly. It represents the Go 1.x version that
will soon open up for development (and eventually become released).

For #40705.
For #53812.

Change-Id: Ic8919a61c9b2f3139717434b9c776d1597175448
Reviewed-on: https://go-review.googlesource.com/c/go/+/420816
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-08-02 18:07:14 +00:00
Russ Cox
1b7e71e8ae all: disable tests that fail on Alpine
These changes are enough to pass all.bash using the
disabled linux-amd64-alpine builder via debugnewvm.

For #19938.
For #39857.

Change-Id: I7d160612259c77764b70d429ad94f0864689cdce
Reviewed-on: https://go-review.googlesource.com/c/go/+/419995
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-02 17:23:42 +00:00
Matthew Dempsky
f2a9f3e2e0 test: improve generic type assertion test
The test added in CL 420394 only tested that the type assertions
compiled at all. This CL changes it into a run test to make sure the
type assertions compile and also run correctly.

Updates #54135.

Change-Id: Id17469faad1bb55ff79b0bb4163ef50179330033
Reviewed-on: https://go-review.googlesource.com/c/go/+/420421
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2022-08-01 20:44:41 +00:00
Wayne Zuo
27038b70f8 cmd/compile: fix wrong dict pass condition for type assertions
Fixes #54135

Change-Id: I2b27af8124014b2699ea44bdc765e1fb8f6c8028
Reviewed-on: https://go-review.googlesource.com/c/go/+/420394
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-08-01 20:18:37 +00:00
Dmitri Shuralyov
e99f53fed9 doc: move Go 1.19 release notes to x/website
Now that the development of the Go 1.19 release is almost done, its
release notes are moved to their eventual long-term home in x/website
in CL 420417. Delete the initial development copy here.

For golang/go#51400.

Change-Id: I741285555af28ce9a64e7f8d2b9fe2a0f3e13c26
Reviewed-on: https://go-review.googlesource.com/c/go/+/420418
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-08-01 18:07:12 +00:00
Matthew Dempsky
8b13a073a1 doc: mention removal of cmd/compile's -importmap and -installsuffix flags
Updates #51225.

Change-Id: I820f3f5ba169635fee37c30e41b370c9399a436d
Reviewed-on: https://go-review.googlesource.com/c/go/+/417534
Reviewed-by: Russ Cox <rsc@golang.org>
2022-08-01 17:07:11 +00:00
WANG Xuerui
e95fd4c238 doc/go1.19: fix typo: EM_LONGARCH -> EM_LOONGARCH
Another last-minute fix. The whole repo is checked case-insensitively
against "longarch" and this is the only occurrence.

Change-Id: If13c123c1e44001a346f1df1df9d839c699703b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/420494
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-01 16:03:51 +00:00
Brad Fitzpatrick
dee3efd9f8 doc/go1.19: fix a few links that were missing trailing slashes
They were part of a chain of three redirects. Now it's only two,
but that's #54081.

Change-Id: Ibfe6a17a372df61df40124892951b48577e4ced9
Reviewed-on: https://go-review.googlesource.com/c/go/+/419634
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-01 12:20:32 +00:00
hopehook
f32519e5fb runtime: fix typos
Change-Id: I30c125be6cb321aa03ea827bd11c3169087e3d4c
Reviewed-on: https://go-review.googlesource.com/c/go/+/420314
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-07-30 16:04:50 +00:00
David Chase
994ff78ba0 [dev.unified] go/internal: set underlying types in proper order
This problem appeared in google-internal testing.
If the run-later functions are run in the wrong order,
type definitions won't resolve properly.

Change-Id: I9da0775976282e92ca036d20fd9fd6650900daf9
Reviewed-on: https://go-review.googlesource.com/c/go/+/419996
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-07-30 00:27:25 +00:00
Ian Lance Taylor
9a2001a8cc cmd/dist: always pass -short=true with -quick
Fixes #53818

Change-Id: I190a8bcf50d92b9c10e9980e630ebb362d8b19ec
Reviewed-on: https://go-review.googlesource.com/c/go/+/417918
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-07-29 22:09:32 +00:00