]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.25] cmd/compile: during regalloc, fixedreg values are always...
authorKeith Randall <khr@golang.org>
Wed, 13 Aug 2025 21:01:30 +0000 (14:01 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 27 Jan 2026 16:57:50 +0000 (08:57 -0800)
commit738bc3a33c115e3ca48793117047390b3fe37392
tree00e7f29361061896a6cdcc76de750c251bc9646b
parent69801b25b9624c3a678ef87d30771861e7bba51f
[release-branch.go1.25] cmd/compile: during regalloc, fixedreg values are always available

It is ok to clobber registers that have a copy of a fixedreg value,
as that value is always available in its original location later
if we need it. (See 14 lines below the change.)

This CL will fix the regalloc infinite loop that CL 678620 introduced.

That CL requests that the stack pointer value be materialized in a
non-stack-pointer register, which is atypical. That condition
triggered the infinite loop that this CL fixes.  The infinite loop is
the compiler trying to reuse that non-stack-pointer register for
something else, but then refusing to give it up because it thought
that non-stack-pointer register held the last copy of the original SP
value.

Fixes #75844

Change-Id: Id604d0937fb9d3753ee273bf1917753d3ef2d5d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/696035
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 9bbea0f21a4539ea365d4804131b17d3b963c4f7)
Reviewed-on: https://go-review.googlesource.com/c/go/+/710875
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/compile/internal/ssa/regalloc.go