Skip to content

Commit 65c365b

Browse files
committed
cmd/compile: fix debug info generation for loads from Phis
Apparently a LoadReg can take a Phi as its argument. The Phi has names in the NamedValue table, so just read the Load's names from the Phi. The example given, XORKeyStream in chacha20, is pretty complicated so I didn't try to actually debug it and verify that the results are right. But the debug logging looks reasonable, with the right names in the right registers at the right times. Fixes #25404 Change-Id: I2c3183dcfb033948556d6805bd66c22c0b45625c Reviewed-on: https://go-review.googlesource.com/114008 Run-TryBot: Heschi Kreinick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 391a963 commit 65c365b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/ssa/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func (state *debugState) liveness() []*BlockDebug {
469469
source = v.Args[0]
470470
case OpLoadReg:
471471
switch a := v.Args[0]; a.Op {
472-
case OpArg:
472+
case OpArg, OpPhi:
473473
source = a
474474
case OpStoreReg:
475475
source = a.Args[0]

0 commit comments

Comments
 (0)