public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/golang] f44: Backport mergelocals.go
Date: Tue, 18 Aug 2026 18:11:00 GMT [thread overview]
Message-ID: <178707666038.1.16006662253036381146.rpms-golang-91558dc07119@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/golang
Branch : f44
Commit : 91558dc07119fa6274d74038cb1bbb4af88b4e07
Author : Alejandro Sáez <asm@redhat.com>
Date : 2026-08-18T18:44:21+02:00
Stats : +109/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/golang/c/91558dc07119fa6274d74038cb1bbb4af88b4e07?branch=f44
Log:
Backport mergelocals.go
Fix failing TestMergeLocalsIntegration test
---
diff --git a/fix-s390x-mergelocals.patch b/fix-s390x-mergelocals.patch
new file mode 100644
index 0000000..230527a
--- /dev/null
+++ b/fix-s390x-mergelocals.patch
@@ -0,0 +1,101 @@
+From 5d5c7ff1f012bb70d653c1a2b282ee46161b6914 Mon Sep 17 00:00:00 2001
+From: "khr@golang.org" <khr@golang.org>
+Date: Tue, 21 Jul 2026 09:19:28 -0700
+Subject: [PATCH] cmd/compile: fix mergelocals for arm32/s390x/riscv64
+
+LoweredZero on arm32 and s390x also take an end-of-zero-range
+address. That input is also an address sink.
+
+Also allow propagation of addresses from input to output of a value,
+so that we handle at least simple address arithmetic. This is required
+to fix riscv64 because it has no indexed load/store, and thus does
+a bunch more explicit address arithmetic than other archs.
+
+Fixes #80484
+
+Change-Id: I126eec1e2cc6c2ab5a39611ccc4d3371dca28292
+Reviewed-on: https://go-review.googlesource.com/c/go/+/803660
+Reviewed-by: Junyang Shao <shaojunyang@google.com>
+Reviewed-by: David du Colombier <0intro@gmail.com>
+LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
+Reviewed-by: Keith Randall <khr@google.com>
+Auto-Submit: Keith Randall <khr@golang.org>
+---
+ .../compile/internal/liveness/mergelocals.go | 19 ++++++++++++++++---
+ src/cmd/compile/internal/ssa/_gen/ARMOps.go | 2 ++
+ src/cmd/compile/internal/ssa/_gen/S390XOps.go | 2 ++
+ 3 files changed, 20 insertions(+), 3 deletions(-)
+
+diff --git a/src/cmd/compile/internal/liveness/mergelocals.go b/src/cmd/compile/internal/liveness/mergelocals.go
+index 28d034a90e..b9be0dd4c9 100644
+--- a/src/cmd/compile/internal/liveness/mergelocals.go
++++ b/src/cmd/compile/internal/liveness/mergelocals.go
+@@ -516,9 +516,22 @@ func (cs *cstate) populateIndirectUseTable(cands []*ir.Name) ([]*ir.Name, []cand
+ for idx, arg := range v.Args {
+ if nc, ok := pendingUses[arg.ID]; ok {
+ if !v.AddrSinkArg(idx) {
+- // If this op may propagate the argument address to its output,
+- // then give up. See issue 80127.
+- continue
++ // If this op may propagate its input address
++ // to somewhere else, we must track where that
++ // somewhere else might be. See issue 80127.
++ if v.Type.IsMemory() {
++ // Might be stored to memory. Give up.
++ continue
++ }
++ // Some sort of address arithmetic.
++ if _, ok := pendingUses[v.ID]; ok {
++ // v has used multiple addresses, which is something
++ // we can't keep track of. Give up.
++ continue
++ }
++ // Treat this op as producing the address of the same variable
++ // that its argument was the address of.
++ pendingUses[v.ID] = nameCount{n: nc.n, count: v.Uses}
+ }
+ // We found a use of some value that took the
+ // address of nc.n. Record this inst as a
+diff --git a/src/cmd/compile/internal/ssa/_gen/ARMOps.go b/src/cmd/compile/internal/ssa/_gen/ARMOps.go
+index b03a09df83..dc16ea6da4 100644
+--- a/src/cmd/compile/internal/ssa/_gen/ARMOps.go
++++ b/src/cmd/compile/internal/ssa/_gen/ARMOps.go
+@@ -508,6 +508,7 @@ func init() {
+ clobberFlags: true,
+ faultOnNilArg0: true,
+ addrSinkArg0: true,
++ addrSinkArg1: true,
+ },
+
+ // large or unaligned move
+@@ -533,6 +534,7 @@ func init() {
+ faultOnNilArg1: true,
+ addrSinkArg0: true,
+ addrSinkArg1: true,
++ // TODO: could use addrSinkArg2 here.
+ },
+
+ // Scheduler ensures LoweredGetClosurePtr occurs only in entry block,
+diff --git a/src/cmd/compile/internal/ssa/_gen/S390XOps.go b/src/cmd/compile/internal/ssa/_gen/S390XOps.go
+index 0fabb2540a..26b9d98241 100644
+--- a/src/cmd/compile/internal/ssa/_gen/S390XOps.go
++++ b/src/cmd/compile/internal/ssa/_gen/S390XOps.go
+@@ -758,6 +758,7 @@ func init() {
+ faultOnNilArg1: true,
+ addrSinkArg0: true,
+ addrSinkArg1: true,
++ // TODO: could use addrSinkArg2 here.
+ },
+
+ // large clear
+@@ -784,6 +785,7 @@ func init() {
+ typ: "Mem",
+ faultOnNilArg0: true,
+ addrSinkArg0: true,
++ addrSinkArg1: true,
+ },
+ }
+
+--
+2.55.0
+
diff --git a/golang.spec b/golang.spec
index 0d67e15..886349f 100644
--- a/golang.spec
+++ b/golang.spec
@@ -159,6 +159,10 @@ Patch8: fix_cgo_panic-with-gcc15-in-368.patch
# Related to https://github.com/golang/go/issues/74476
Patch9: skip_lsan_tests.patch
+# Related to the regeneration of `_gen/` in the build phase:
+# git format-patch -1 5d5c7ff1f0 --stdout -- ':!src/cmd/compile/internal/ssa/opGen.go' > fix-s390x-mergelocals.patch
+Patch10: fix-s390x-mergelocals.patch
+
# Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4
@@ -323,6 +327,10 @@ export GO_LDFLAGS="-linkmode internal"
%if !%{cgo_enabled}
export CGO_ENABLED=0
%endif
+# Regenerate `_gen/` before building
+pushd cmd/compile/internal/ssa/_gen
+GOROOT=%{goroot} %{goroot}/bin/go run .
+popd
./make.bash -v
popd
reply other threads:[~2026-08-18 18:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178707666038.1.16006662253036381146.rpms-golang-91558dc07119@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox