aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkhr@golang.org <khr@golang.org>2025-02-23 10:34:00 -0800
committerKeith Randall <khr@golang.org>2025-02-25 10:19:25 -0800
commitcc16fb52e6f1eafaee468f8563525ec391e016f5 (patch)
treef4f8fc21b0ce47660019362455c2eb5f81a4ea16 /src
parent1e92ff11f5fa9d495c05414591516402a202539c (diff)
downloadgo-cc16fb52e6f1eafaee468f8563525ec391e016f5.tar.xz
cmd/compile: ensure we don't reuse temporary register
Before this CL, we could use the same register for both a temporary register and for moving a value in the output register out of the way. Fixes #71857 Change-Id: Iefbfd9d4139136174570d8aadf8a0fb391791ea9 Reviewed-on: https://go-review.googlesource.com/c/go/+/651221 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/ssa/regalloc.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/regalloc.go b/src/cmd/compile/internal/ssa/regalloc.go
index 1b7bcb2b1d..d794098b9d 100644
--- a/src/cmd/compile/internal/ssa/regalloc.go
+++ b/src/cmd/compile/internal/ssa/regalloc.go
@@ -1677,6 +1677,7 @@ func (s *regAllocState) regalloc(f *Func) {
}
tmpReg = s.allocReg(m, &tmpVal)
s.nospill |= regMask(1) << tmpReg
+ s.tmpused |= regMask(1) << tmpReg
}
// Now that all args are in regs, we're ready to issue the value itself.