go.tools/ssa: fix bug: lifting pass invalidated Referrers info for DebugRef's X operand.

Tested: by enabling debug info globally in stdlib_test,
the existing sanity checks catch it.

R=gri
CC=golang-codereviews
https://golang.org/cl/50570043
This commit is contained in:
Alan Donovan 2014-01-10 17:10:12 -05:00
parent 3d82e7e94a
commit d2fe54b33c
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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