]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: ensure we use allowed registers for input-clobbering instructions master
authorKeith Randall <khr@golang.org>
Mon, 18 Aug 2025 17:17:27 +0000 (10:17 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 18 Aug 2025 19:15:08 +0000 (12:15 -0700)
commit5a56d8848b4ffb79c5ccc11ec6fa01823a91aaf8
tree527ffe3cd347ccd55c786be68e08d430fa0f0172
parentc3927a47f092fc7248d973f4d8a64ab410804986
cmd/compile: ensure we use allowed registers for input-clobbering instructions

For instructions which clobber their input register, we make a second
copy of the input value so it is still available in a register for
future instructions.

That second copy might not respect the register input restrictions
for the instruction. So the second copy we make here can't actually
be used by the instruction - it should use the first copy, the second
copy is the one that will persist beyond the clobber.

Fixes #75063

Change-Id: I99acdc63f0c4e54567a174ff7ada601ae4e796b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/697015
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/ssa/regalloc.go
test/fixedbugs/issue75063.go [new file with mode: 0644]