From: Keith Randall Date: Sat, 11 Jul 2015 21:41:22 +0000 (-0700) Subject: [dev.ssa] cmd/compile/internal/ssa: Phi inputs from dead blocks are not live X-Git-Tag: go1.7beta1~1623^2^2~400 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=050ce4390aa16b03e7272e22e79de165589319b5;p=gostls13.git [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 --- diff --git a/src/cmd/compile/internal/ssa/deadcode.go b/src/cmd/compile/internal/ssa/deadcode.go index 2be7b8ebaf..1b1ae27e58 100644 --- a/src/cmd/compile/internal/ssa/deadcode.go +++ b/src/cmd/compile/internal/ssa/deadcode.go @@ -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