mirror of
https://github.com/golang/go
synced 2024-10-05 18:31:28 -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:
parent
7a982e3c49
commit
050ce4390a
@ -44,7 +44,10 @@ func deadcode(f *Func) {
|
||||
// pop a reachable value
|
||||
v := 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] {
|
||||
live[x.ID] = true
|
||||
q = append(q, x) // push
|
||||
|
Loading…
Reference in New Issue
Block a user