]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: enforce that locals are always accessed with SP base register
authorKeith Randall <khr@golang.org>
Fri, 1 Aug 2025 14:38:55 +0000 (07:38 -0700)
committerKeith Randall <khr@golang.org>
Fri, 1 Aug 2025 15:57:29 +0000 (08:57 -0700)
commiteef5f8d93016147718afba8a05282d2ba7332c51
tree758ad8a47cfbdeac24716e7408ac9a35c2c8642a
parente071617222e373f59db8995ce171bae708e0dcef
cmd/compile: enforce that locals are always accessed with SP base register

After CL 678937, we could have a situation where the value of the
stack pointer is in both SP and another register. We need to make sure
that regalloc picks SP when issuing a reference to local variables;
the assembler expects that.

Fixes #74836

Change-Id: I2ac73ece6eb44b4a78c1369f8a69e51ab9748754
Reviewed-on: https://go-review.googlesource.com/c/go/+/692395
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Mark Freeman <mark@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/ssa/regalloc.go
test/fixedbugs/issue74836.go [new file with mode: 0644]