]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: correct maintain use count when phi args merge
authorDavid Chase <drchase@google.com>
Thu, 17 Mar 2016 20:14:41 +0000 (16:14 -0400)
committerDavid Chase <drchase@google.com>
Thu, 17 Mar 2016 20:55:13 +0000 (20:55 +0000)
The critical phase did not correctly maintain the use count
when two predecessors of a new critical block transmit the
same value.

Change-Id: Iba802c98ebb84e36a410721ec32c867140efb6d4
Reviewed-on: https://go-review.googlesource.com/20822
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
src/cmd/compile/internal/ssa/critical.go

index b414913f94bdee6883f2320b3d9bb697a5e01da9..38d4ca40dd197f97c2ff633c0c16532c5b05e571 100644 (file)
@@ -79,6 +79,7 @@ func critical(f *Func) {
                        if reusedBlock {
                                d.Preds = append(d.Preds, c)
                                b.Preds[i] = nil
+                               phi.Args[i].Uses--
                                phi.Args[i] = nil
                        } else {
                                // splice it in