1
0
mirror of https://github.com/golang/go synced 2024-10-05 22:21:23 -06:00

[dev.ssa] cmd/compile/internal/ssa: Phi inputs from dead blocks are not live

Fixes #11676

Change-Id: I941f951633c89bb1454ce6d1d1b4124d46a7d9dd
Reviewed-on: https://go-review.googlesource.com/12091
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Keith Randall 2015-07-11 14:41:22 -07:00
parent 7a982e3c49
commit 050ce4390a

View File

@ -44,7 +44,10 @@ func deadcode(f *Func) {
// pop a reachable value // pop a reachable value
v := q[len(q)-1] v := q[len(q)-1]
q = q[:len(q)-1] q = q[:len(q)-1]
for _, x := range v.Args { for i, x := range v.Args {
if v.Op == OpPhi && !reachable[v.Block.Preds[i].ID] {
continue
}
if !live[x.ID] { if !live[x.ID] {
live[x.ID] = true live[x.ID] = true
q = append(q, x) // push q = append(q, x) // push