From 65c365bf0f4add682419ba8fe68db43a0cab0e83 Mon Sep 17 00:00:00 2001 From: Heschi Kreinick Date: Tue, 22 May 2018 18:08:12 -0400 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/compile/internal/ssa/debug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/debug.go b/src/cmd/compile/internal/ssa/debug.go index 327dd916e7e78a..c4f90ebff29e36 100644 --- a/src/cmd/compile/internal/ssa/debug.go +++ b/src/cmd/compile/internal/ssa/debug.go @@ -469,7 +469,7 @@ func (state *debugState) liveness() []*BlockDebug { source = v.Args[0] case OpLoadReg: switch a := v.Args[0]; a.Op { - case OpArg: + case OpArg, OpPhi: source = a case OpStoreReg: source = a.Args[0]