mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue