]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ssa: clear branch likeliness in clobberBlock
authorPhilip Hofer <phofer@umich.edu>
Wed, 21 Feb 2018 21:35:08 +0000 (13:35 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 27 Feb 2018 18:14:05 +0000 (18:14 +0000)
The branchelim pass makes some blocks unreachable, but does not
remove them from Func.Values. Consequently, ssacheck complains
when it finds a block with a non-zero likeliness value but no
successors.

Fixes #24014

Change-Id: I2dcf1d8f4e769a2f363508dab3b11198ead336b6
Reviewed-on: https://go-review.googlesource.com/96075
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Philip Hofer <phofer@umich.edu>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/ssa/branchelim.go

index a37b8f06e191c2d5abae5a6754c1e797be5136d6..54508985b369452155391e2684f4d9316f9dd4e6 100644 (file)
@@ -139,6 +139,7 @@ func clobberBlock(b *Block) {
        b.Succs = nil
        b.Aux = nil
        b.SetControl(nil)
+       b.Likely = BranchUnknown
        b.Kind = BlockInvalid
 }