aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/branchelim.go
diff options
context:
space:
mode:
authorPhilip Hofer <phofer@umich.edu>2018-02-21 13:35:08 -0800
committerJosh Bleecher Snyder <josharian@gmail.com>2018-02-27 18:14:05 +0000
commit81786649c54c5e45765de12cbdf11c9081614506 (patch)
tree760e29213e02b0e133ab560bfc2e439080f9d7a7 /src/cmd/compile/internal/ssa/branchelim.go
parentc5d6c42d35059bb911cf9f4a77704438ab4f9de0 (diff)
downloadgo-81786649c54c5e45765de12cbdf11c9081614506.tar.gz
go-81786649c54c5e45765de12cbdf11c9081614506.zip
cmd/compile/internal/ssa: clear branch likeliness in clobberBlock
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>
Diffstat (limited to 'src/cmd/compile/internal/ssa/branchelim.go')
-rw-r--r--src/cmd/compile/internal/ssa/branchelim.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/branchelim.go b/src/cmd/compile/internal/ssa/branchelim.go
index a37b8f06e1..54508985b3 100644
--- a/src/cmd/compile/internal/ssa/branchelim.go
+++ b/src/cmd/compile/internal/ssa/branchelim.go
@@ -139,6 +139,7 @@ func clobberBlock(b *Block) {
b.Succs = nil
b.Aux = nil
b.SetControl(nil)
+ b.Likely = BranchUnknown
b.Kind = BlockInvalid
}