From ad3db2562edf23cb4fb9a909ea11d57b65e304fb Mon Sep 17 00:00:00 2001 From: Junyang Shao Date: Tue, 16 Sep 2025 03:27:41 +0000 Subject: [PATCH] cmd/compile: handle rematerialized op for incompatible reg constraint This CL fixes an issue raised by contributor dominikh@. Cherry-picked from the dev.simd branch. This CL is not necessarily SIMD specific. Apply early to reduce risk. Test is SIMD specific so not included for now. Change-Id: I941b330a6ba6f6c120c69951ddd24933f2f0b3ec Reviewed-on: https://go-review.googlesource.com/c/go/+/704056 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase Reviewed-on: https://go-review.googlesource.com/c/go/+/708861 --- src/cmd/compile/internal/ssa/regalloc.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/regalloc.go b/src/cmd/compile/internal/ssa/regalloc.go index 26c742d7fe..88861dfa14 100644 --- a/src/cmd/compile/internal/ssa/regalloc.go +++ b/src/cmd/compile/internal/ssa/regalloc.go @@ -2561,7 +2561,26 @@ func (e *edgeState) processDest(loc Location, vid ID, splice **Value, pos src.XP e.s.f.Fatalf("can't find source for %s->%s: %s\n", e.p, e.b, v.LongString()) } if dstReg { - x = v.copyInto(e.p) + // Handle incompatible registers. + // For #70451. + if e.s.regspec(v).outputs[0].regs®Mask(1<