1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:14:43 -07:00
Commit Graph

57895 Commits

Author SHA1 Message Date
Than McIntosh
19ca2337c5 cmd/compile/internal/inline: build call site table
Build up a table of (potentially) inlinable call sites during inline
heuristic analysis, and introduce a framework for analyzing each call
site to collect applicable flags (for example, is call nested in
loop). This patch doesn't include any of the flag analysis, just the
machinery to collect the callsites and a regression test harness.

Updates #61502.

Change-Id: Ieaf4a008ac9868e9762c63f5b59bd264dc71ab30
Reviewed-on: https://go-review.googlesource.com/c/go/+/511564
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 23:03:03 +00:00
Than McIntosh
d2024a091d cmd/compile/internal/inline: extend flag calculation via export data
Extend the code that computes various properties and parameter flags
to incorporate information from export data in addition to things we
can get from the current package. Specifically:

 - when deciding whether the current function always calls panic/exit,
   check to see whether it has an unconditional call to some other
   function that has that flag.

 - when computing "parameter feeds" properties, look not just for
   cases where a parameter feeds an interesting construct (if/switch,
   indirect/interface call, etc) but where it feeds a call whose
   corresponding param has that flag.

 - when computing return properties, if a given return is always the
   results of a call to X, then set the return properties to those
   of X.

Updates #61502.

Change-Id: I6472fe98759cccad05b8eed58e4fc568201d88ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/511563
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 23:02:38 +00:00
Than McIntosh
323cf73091 cmd/compile: write "properties" to export data for inlinable funcs
Augment the ir.Inline container to include an entry for function
properties (currently serialized as a string), and if
GOEXPERIMENT=newinliner is set, compute and store function
properties for all inline candidates processed by the inliner.

The idea here is that if the function properties are going to drive
inlining decisions, we'd like to have the same info from non-local /
imported functions as for local / in-package functions, hence we need
to include the properties in the export data.

Hand testing on the compiler itself and with k8s kubelet shows that
this increases the size of export data overall by about 2-3 percent,
so a pretty modest increase.

Updates #61502.

Change-Id: I9d1c311aa8418d02ffea3629c3dd9d8076886d15
Reviewed-on: https://go-review.googlesource.com/c/go/+/511562
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-09-08 23:02:15 +00:00
Than McIntosh
906a073b0b cmd/compile/internal/inline: analyze function param properties
Add code to analyze properties of function params, specifically
heuristics to look for cases where unmodified params feed into "if"
and "switch" statements in ways that might enable constant folding
and/or dead code elimination if the call were inlined at a callsite
that passes a constant to the correct param. We also look for cases
where a function parameter feeds unmodified into an interface method
call or indirect call.

Updates #61502.

Change-Id: Iaf7297e19637daeabd0ec72be88d654b545546ae
Reviewed-on: https://go-review.googlesource.com/c/go/+/511561
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-09-08 23:01:53 +00:00
Egon Elbre
2fe2f08542 cmd/cgo: silence unaligned-access
Clang 14+ introduced a warning when using mixed packed and unpacked structs.
This can cause problems when taking an address of the unpacked struct, which
may end up having a different alignment than expected.

This is not a problem in cgo, which does not take pointers from the packed
struct.

Fixes #62480

Change-Id: If5879eea5e1b77bc6dc7430f68f8c916bff9b090
Reviewed-on: https://go-review.googlesource.com/c/go/+/526915
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 22:57:46 +00:00
Bryan C. Mills
2e7e1d2e8d net: synchronize calls to Close in the withTCPConnPair test helper
withTCPConnPair is supposed to return only when both peer functions
have completed. However, due to the use of "defer" it was closing the
peers' connections after the synchronization point instead of before.

Fixes #62542.

Change-Id: I3e06c78984664172ff2d28b0fc582b8182f710f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/526977
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Commit-Queue: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-09-08 20:56:46 +00:00
Jonathan Amsterdam
a742ae493f testing/slogtest: add Run to run cases as subtests
This is an implementation of proposal #61758.

It adds a function to slogtest that runs each test case in a subtest,
instead of running them all at once.

That allows the caller to control which cases are run.

Fixes #61706.
Fixes #61758.

Change-Id: I95108b7b753675203ca7f0f00ccbc242bd9c2a9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/516076
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
2023-09-08 20:37:12 +00:00
Michael Pratt
af3bf866b1 runtime: dump rdx on windows
CL 177090043 accidentally dropped RDX when converting from C.

Change-Id: I6bf9dc1b1d0c2850967005c048245d1185dcede4
Reviewed-on: https://go-review.googlesource.com/c/go/+/526976
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
2023-09-08 20:27:22 +00:00
Cherry Mui
dfbf809f2a runtime: unskip TestG0StackOverflow
The stack bounds from pthread are not always accurate, and could
cause seg fault if we run out of the actual stack space before
reaching the bounds. Here we use an artificially small stack bounds
to check overflow without actually running out of the system stack.

Change-Id: I8067c5e1297307103b315d9d0c60120293b57aab
Reviewed-on: https://go-review.googlesource.com/c/go/+/523695
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 19:14:29 +00:00
Matthew Dempsky
5d9e0be159 cmd/compile/internal/ssa: replace Frontend.Auto with Func.NewLocal
Change-Id: I0858568d225daba1c318842dc0c9b5e652dff612
Reviewed-on: https://go-review.googlesource.com/c/go/+/526519
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2023-09-08 19:09:14 +00:00
Matthew Dempsky
5d6f835b3e cmd/compile/internal/ssagen: call AllocFrame after ssa.Compile
This indirection is no longer necessary.

Change-Id: Ibb5eb1753febdc17a93ea9c35130e3d2b26c360e
Reviewed-on: https://go-review.googlesource.com/c/go/+/526518
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2023-09-08 19:05:18 +00:00
Joe Tsai
dac9b9ddbd encoding: modernize Go documentation
Across all encoding packages, linkify declarations if possible.
In some cases, we convert a code block into a bulleted list,
which then further allows for more linkification.

Change-Id: I68fedf362615b34228bab5d4859b7d87d831c570
Reviewed-on: https://go-review.googlesource.com/c/go/+/524977
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-09-08 19:04:28 +00:00
Matthew Dempsky
45d3d10071 cmd/compile/internal/ssa: rename ssagen.TypeOK as CanSSA
No need to indirect through Frontend for this.

Change-Id: I5812eb4dadfda79267cabc9d13aeab126c1479e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/526517
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 19:03:54 +00:00
Matthew Dempsky
af8a2bde7b cmd/compile/internal/ssa: remove Frontend.MyImportPath
This method is only used to find the path of the function being
compiled for hash debugging, but it was instead returning the path of
the package being compiled. These are typically the same, but can be
different for certain functions compiled across package boundaries
(e.g., method value wrappers and generic functions).

It's redundant either with f.fe.Func().Sym().Pkg.Path (package path of
the function being compiled) or f.Config.ctxt.Pkgpath (package path of
the compilation unit), so just remove it instead.

Change-Id: I1daae09055043d0ecb1fcc874a0b0006a6f8bddf
Reviewed-on: https://go-review.googlesource.com/c/go/+/526516
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2023-09-08 19:01:07 +00:00
Matthew Dempsky
9c9fcabb02 cmd/compile/internal/ssa: simplify NewFunc API
Add Config and Cache as params rather than documenting that the caller
has to set them manually.

Change-Id: I8d530be695a0c94bcc4211b496d6e57ec2fff029
Reviewed-on: https://go-review.googlesource.com/c/go/+/526515
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2023-09-08 19:01:04 +00:00
Matthew Dempsky
729e21b24c cmd/compile: cleanup uses of ir.Orig and ir.SepCopy
Mostly automated refactoring with gofmt:

gofmt -r 'ir.Orig(n) -> n'
gofmt -r 'ir.SepCopy(n) -> ir.Copy(n)'

Followed by some manual cleanups.

Change-Id: Ib35abeba9e60b70ba463e161fb39358fb058a83e
Reviewed-on: https://go-review.googlesource.com/c/go/+/526398
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 18:57:57 +00:00
Matthew Dempsky
d2eab5ff19 cmd/compile/internal/ir: remove OrigNode
The OrigNode functionality used to be relevant to the typecheck
frontend, because we wanted to report errors using the same syntax as
the user originally wrote. However, now that types2 handles all
spec-required error diagnostics, there's no need to preserve original
nodes anymore.

Change-Id: I64a0540b8952513913021e7b84d165beb1f9f801
Reviewed-on: https://go-review.googlesource.com/c/go/+/526397
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 18:56:07 +00:00
Matthew Dempsky
0a49d4a778 cmd/compile/internal/ir: simplify formatting of CompLitExpr
Composite literals always have a type now, so the extra fallback code
isn't necessary. But also, to prepare for the upcoming removal of
OrigNode, we need to print OSLICELIT with Implicit set as
"... argument" to satisfy existing regress tests.

Change-Id: I365e879066903eebf1b78e10c1b505565cea3ce3
Reviewed-on: https://go-review.googlesource.com/c/go/+/526396
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2023-09-08 18:54:34 +00:00
Matthew Dempsky
7f1f4a1936 cmd/internal/ir: remove ConstExpr in favor of BasicLit
OrigNode will be going away soon, which is the only reason for
ConstExpr to exist. Otherwise, it's identical to BasicLit.

To keep existing code working, change NewConstExpr to construct and
return a BasicLit instead.

Change-Id: I68b43ec1fcaa57e6723f289ce9f953996aeefb14
Reviewed-on: https://go-review.googlesource.com/c/go/+/526395
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
2023-09-08 18:51:02 +00:00
Matthew Dempsky
18c6ec1e4a cmd/compile/internal/noder: stop preserving original const strings
One of the more tedious quirks of the original frontend (i.e.,
typecheck) to preserve was that it preserved the original
representation of constants into the backend. To fit into the unified
IR model, I ended up implementing a fairly heavyweight workaround:
simply record the original constant's string expression in the export
data, so that diagnostics could still report it back, and match the
old test expectations.

But now that there's just a single frontend to support, it's easy
enough to just update the test expectations and drop this support for
"raw" constant expressions.

Change-Id: I1d859c5109d679879d937a2b213e777fbddf4f2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/526376
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2023-09-08 18:50:24 +00:00
Cherry Mui
c6d550a668 runtime: increase g0 stack size in non-cgo case
Currently, for non-cgo programs, the g0 stack size is 8 KiB on
most platforms. With PGO which could cause aggressive inlining in
the runtime, the runtime stack frames are larger and could
overflow the 8 KiB g0 stack. Increase it to 16 KiB. This is only
one per OS thread, so it shouldn't increase memory use much.

Fixes #62120.
Fixes #62489.

Change-Id: I565b154517021f1fd849424dafc3f0f26a755cac
Reviewed-on: https://go-review.googlesource.com/c/go/+/526995
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 18:40:23 +00:00
zhouguangyuan
2b3c1c5937 cmd/internal/obj: mark unspill code in prologue preemptible
The UnspillReg code should always be preemptible because all the arg registers will be saved by runtime.asyncpreempt.

Change-Id: Ie36b5d0cdd1275efcb95661354d83be2e1b00a86
Reviewed-on: https://go-review.googlesource.com/c/go/+/526235
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-09-08 18:36:45 +00:00
Dmitri Shuralyov
527b6bbac1 syscall: skip unshare tests if mount syscall is not available
CL 513779 added crude skips for tests that couldn't work when run under
'unshare --net --map-root-user' as used by the current iteration of the
no-network check in LUCI. Bryan suggested a more targeted way to detect
when the environment is insufficient, which makes it possible to remove
the builder-specific skip and its slightly incorrect explaining comment.

Updates #30612.

Change-Id: I0de79f44ab94d7f1018384c2e959ca7df3a1b0ae
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-amd64-longtest-race
Reviewed-on: https://go-review.googlesource.com/c/go/+/526835
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-09-08 17:56:56 +00:00
Archana
b0ae440bf0 runtime: support for debugger function calls on linux/ppc64le
This CL adds support for debugger function calls on linux ppc64le
platform. The protocol is basically the same as in CL 395754, except for
the following differences:
1, The abi differences which affect parameter passing and frame layout.
2, The closure register is R11.
3, Minimum framesize on pp64le is 32 bytes
4, Added functions to return parent context structure for general purpose
   registers in order to work with the way these structures are defined in
   ppc64le

Change-Id: I58e01fedad66a818ab322e2b2d8f5104cfa64f39
Reviewed-on: https://go-review.googlesource.com/c/go/+/512575
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Archana Ravindar <aravinda@redhat.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-08 15:08:04 +00:00
Daniel Martí
2f0b28da19 fmt: adjust comment after CL 524940
https://go.dev/cl/524940 swapped a call to Slice with Bytes,
but the comment below still referenced Slice.

Change-Id: Iedc772e1c49c4108bcd06f4cea0e637f011d053c
Reviewed-on: https://go-review.googlesource.com/c/go/+/526356
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: t hepudds <thepudds1460@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-09-08 06:28:03 +00:00
Joel Sing
1152615d20 debug/elf,cmd/link: add additional MIPS64 relocation type
Add R_MIPS_PC32 which is a 32 bit PC relative relocation.

These are produced by LLVM on mips64.

Fixes #61974

Change-Id: I7b6c6848e40249e6d5ea474ea53c9d7e3ab23f88
Reviewed-on: https://go-review.googlesource.com/c/go/+/469395
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Junxian Zhu <zhujunxian@oss.cipunited.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-09-08 04:32:10 +00:00
Joel Sing
7f57499853 cmd/internal/obj/riscv: clean up error checking for encoding
Replace a "fixme" with a more appropriate error. Also invert the condition
so that the error returns early, which is more Go idiomatic.

Change-Id: I03006572c4010fb47037bed3ee1fd7f92bfc20d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/523457
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: M Zhuo <mzh@golangcn.org>
2023-09-08 04:21:30 +00:00
Joel Sing
216c512198 cmd/internal/obj/riscv: correct message in regVal panic
Change-Id: I68be4110216145ad1fb2e5095e1f2b143f9e69ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/523456
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: M Zhuo <mzh@golangcn.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
2023-09-08 04:21:02 +00:00
Joel Sing
13d5ca42fd cmd/internal/obj/riscv: simplify instructionsForMOV
Rather than handling shift based scaling in two locations, rework logic
so there is a single exit path.

Change-Id: I832b4932d53183736050059a11019ced08281b3b
Reviewed-on: https://go-review.googlesource.com/c/go/+/523455
Reviewed-by: M Zhuo <mzh@golangcn.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-09-08 04:20:37 +00:00
Ian Lance Taylor
834a6f9a33 cmd/api: don't try to parse JSON from stderr of go list
Just send the go list stderr to our stderr.

Change-Id: Iacda573bbe7accbcecb6a957e5d42b55afd10c58
Reviewed-on: https://go-review.googlesource.com/c/go/+/526775
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-09-07 23:30:03 +00:00
qmuntal
1d538f198d runtime: support nil libcall.args when calling stdcall on Windows
Having to pass a dummy pointer to the libcall.args field is a bit
annoying. This change allows nil to be passed instead.

windows/arm and windows/arm64 already support nil libcall.args.

Change-Id: I07a2bdb7d1f76b13d125397ff5177337c43536a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/526016
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-09-07 21:16:03 +00:00
Tobias Klauser
3a124de515 syscall: remove unused ptracePtr on darwin
ptracePtr was introduced in CL 470299 for darwin but it's not used on
this platform. Also, the argument types for addr and data were swapped
in the generated ptrace1Ptr (probably because the change was not
generated but done manually).

For #58387

Change-Id: I429ab0c741e19020d98729c34efabce1d9003f56
Reviewed-on: https://go-review.googlesource.com/c/go/+/526475
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 21:07:58 +00:00
limeidan
02d581ef53 cmd/link/internal/loong64: correct the glibc dynamic linker path.
Ref: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_program_interpreter_path

Change-Id: Ic2598110cc091362cb09f877b6b86433cacf32c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/526535
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-09-07 20:05:07 +00:00
Daniel Martí
65f245af49 encoding/xml: use reflect.Value.Bytes on addressable arrays
Since #47066 was accepted and implemented,
reflect.Value.Bytes can be called directly on addressable arrays,
so there is no longer a need to go through a slice first.

Change-Id: I04d50ddb1b38e7a37fee3dc8be1bd03b22a06a1c
Reviewed-on: https://go-review.googlesource.com/c/go/+/526357
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-09-07 19:38:51 +00:00
Paul E. Murphy
d80f3966b8 cmd/internal/obj/ppc64: do not assemble non-constant rotate RLWMI
Unlike RLWNM, the ISA only supports an immediate rotate operand.

Update optab and opirrr to avoid quietly assembling this insn.

Change-Id: I1472a431cb8a870d55d5fff79ab905c4c459f630
Reviewed-on: https://go-review.googlesource.com/c/go/+/449835
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 19:20:03 +00:00
Kir Kolyshkin
2b46cffe57 syscall: improve linux SysProcAttr documentation
The SysProcAttr is OS-specific anyway, so it makes little sense to say
that some fields are Linux-specific (they all are anyway).

While at it, make sure to use complete sentences (add missing periods).

Change-Id: Ic0afe3920c2561fd9a657f4edab21939a8f56d57
Reviewed-on: https://go-review.googlesource.com/c/go/+/525395
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 19:17:23 +00:00
Pascal S. de Kloe
0bbd273e97 cmd/doc: print bugs with -all flag
Includes cleanup and deduplication.

fixes: #33970

Change-Id: I7e84b3e5c8fb9c560cf0a1f8b7cbb7a6977666aa
Reviewed-on: https://go-review.googlesource.com/c/go/+/511935
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-09-07 19:16:55 +00:00
Kir Kolyshkin
da7ee57f40 syscall: add support to get pidfd from ForkExec on Linux
Add PidFD support, so that if the PidFD pointer in SysProcAttr is not
nil, ForkExec (and thus all its users) obtains a pidfd from the kernel
during clone(), and writes the result (or -1, if the functionality
is not supported by the kernel) into *PidFD.

The functionality to get pidfd is implemented for both clone3 and clone.
For the latter, an extra argument to rawVforkSyscall is needed, thus the
change in asm files.

Add a trivial test case checking the obtained pidfd can be used to send
a signal to a process, using pidfd_send_signal. To test clone3 code path,
add a flag available to tests only.

Updates #51246.

Change-Id: I2212b69e1a657163c31b4a6245b076bc495777a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/520266
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com>
2023-09-07 19:11:15 +00:00
Jes Cok
584d646559 encoding/gob: fix typo in comment for decAlloc
Change-Id: I89c607ee40358d6d650ba0ea1f05ce7d1df698bd
GitHub-Last-Rev: e78a371180
GitHub-Pull-Request: golang/go#62319
Reviewed-on: https://go-review.googlesource.com/c/go/+/523376
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Rob Pike <r@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 19:10:23 +00:00
Jes Cok
9a9aa6e238 encoding/gob: make comment more idiomatic for *Encoder.writer
Change-Id: I89a4d7f4af8dfb67a35647283be6c1d2965595f5
GitHub-Last-Rev: f7c11c156c
GitHub-Pull-Request: golang/go#62389
Reviewed-on: https://go-review.googlesource.com/c/go/+/524735
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Rob Pike <r@golang.org>
2023-09-07 19:09:56 +00:00
Jes Cok
96fe257a42 encoding/gob: swap 'err, i' to correct verbs in decUint8Slice
Change-Id: I76b2dd45179f65e9ed4f1d0f597ca59e49b59a85
GitHub-Last-Rev: b4171e6b83
GitHub-Pull-Request: golang/go#62374
Reviewed-on: https://go-review.googlesource.com/c/go/+/524356
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 19:09:54 +00:00
Jes Cok
ac2ec69e19 all: use io.{SeekStart, SeekCurrent, SeekEnd}
Currently we include these symbols in bootstrap code.

Change-Id: I19b504237b0344f0e87cda0fbe651811c72daba1
GitHub-Last-Rev: 5134baec38
GitHub-Pull-Request: golang/go#62368
Reviewed-on: https://go-review.googlesource.com/c/go/+/524258
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2023-09-07 19:06:17 +00:00
qmuntal
4beb33018b runtime: remove slow time compatibility hacks for wine
This reapplies CL 191759, which was reverted in CL 192622.

Wine fixed the compatibility issue more than 3 years
ago, in version 5.10 (see [1]). We no longer have to keep the compatibility hack on our side.

Updates #34021

[1]: 1ae1088964

Change-Id: I3b77701d01fdf58fbf350321fc0a957c0f247d32
Reviewed-on: https://go-review.googlesource.com/c/go/+/526358
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 17:19:45 +00:00
Andy Pan
31c1f4a611 log/slog: use the general regex expression of datetime in TestPanics
When I added this test in CL 514135, I missed the timeRE,
we should use it to make this test more precise.

Change-Id: I486f8e8bbbc3a17166107ef361d242ddf4ea2928
Reviewed-on: https://go-review.googlesource.com/c/go/+/525556
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-09-07 17:11:06 +00:00
qiulaidongfeng
a35bb44adc sync: deemphasize goroutines in RWMutex documentation
Fixes #41555

Change-Id: I46b9535b1687d481d2ac76296e8ba7de26d6e2e2

Change-Id: I46b9535b1687d481d2ac76296e8ba7de26d6e2e2
GitHub-Last-Rev: 38af46c189
GitHub-Pull-Request: golang/go#61977
Reviewed-on: https://go-review.googlesource.com/c/go/+/518859
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
2023-09-07 16:18:47 +00:00
Tobias Klauser
dc6513b89f net: remove unused _C_GoString
It's unused since CL 466335.

Change-Id: I2750f478bd2a1cde270a6273551e1434cb38b5ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/526076
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-09-07 16:10:42 +00:00
Michael Anthony Knyszek
d9a4b24a17 runtime: always lock OS thread in debugcall
Right now debuggers like Delve rely on the new goroutine created to run
a debugcall function to run on the same thread it started on, up until
it hits itself with a SIGINT as part of the debugcall protocol.

That's all well and good, except debugCallWrap1 isn't particularly
careful about not growing the stack. For example, if the new goroutine
happens to have a stale preempt flag, then it's possible a stack growth
will cause a roundtrip into the scheduler, possibly causing the
goroutine to switch to another thread.

Previous attempts to just be more careful around debugCallWrap1 were
helpful, but insufficient. This change takes everything a step further
and always locks the debug call goroutine and the new goroutine it
creates to the OS thread.

For #61732.

Change-Id: I038f3a4df30072833e27e6a5a1ec01806a32891f
Reviewed-on: https://go-review.googlesource.com/c/go/+/515637
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-09-07 15:25:07 +00:00
Keith Randall
fb5bdb4cc9 cmd/compile: absorb InvertFlags into Noov comparisons
Unfortunately, there isn't a single op that provides the resulting
computation.
At least, I couldn't find one.

Fixes #62469

Change-Id: I236f3965b827aaeb3d70ef9fe89be66b116494f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/526276
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
2023-09-07 15:14:39 +00:00
Matthew Dempsky
0725410df5 cmd/compile/internal/inline/inlheur: remove ConstExpr assumption
OLITERAL isn't always ConstExpr. It can also be BasicLit or Name.

Change-Id: I44d595830f9e206eccf6fb37bd47ddf957db0866
Reviewed-on: https://go-review.googlesource.com/c/go/+/526277
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
2023-09-07 15:10:40 +00:00
Matthew Dempsky
ae09ca6c0f cmd/compile/internal/ir: simplify printing of OLITERALs
This formatting used to be relevant to user error diagnostics and
(much earlier) even to the old textual export data format, but now
it's only relevant to backend debugging. So we can simplify a lot,
adjusting a few test expectations accordingly.

Change-Id: Ibe8e029284ce6150bfa24ef794d8d9eff66dbdea
Reviewed-on: https://go-review.googlesource.com/c/go/+/526375
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2023-09-07 15:10:10 +00:00