diff --git a/ssa/lift.go b/ssa/lift.go index 61198645..f285f2d5 100644 --- a/ssa/lift.go +++ b/ssa/lift.go @@ -523,6 +523,11 @@ func rename(u *BasicBlock, renaming []Value, newPhis newPhiMap) { if instr.IsAddr { instr.X = renamed(renaming, alloc) instr.IsAddr = false + + // Add DebugRef to instr.X's referrers. + if refs := instr.X.Referrers(); refs != nil { + *refs = append(*refs, instr) + } } else { // A source expression denotes the address // of an Alloc that was optimized away. diff --git a/ssa/stdlib_test.go b/ssa/stdlib_test.go index a99ec2f5..ac5bd6fa 100644 --- a/ssa/stdlib_test.go +++ b/ssa/stdlib_test.go @@ -23,7 +23,7 @@ import ( "code.google.com/p/go.tools/ssa/ssautil" ) -const debugMode = false +const debugMode = true // cost: +30% space, +18% time for SSA building func allPackages() []string { var pkgs []string