Commit e7b7f874 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: invalidate CFG when fuseIf triggers

The compiler appears to have a latent bug:
fusePlain calls invalidateCFG when it changes block structure,
but fuseIf does not.

Fix this by hoisting the call to invalidateCFG to the top level.

Change-Id: Ic960fb3ac963b15b4a225aad84863d58efa954e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/177198
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 822a9f53
......@@ -36,6 +36,9 @@ func fuse(f *Func, typ fuseType) {
changed = fuseBlockPlain(b) || changed
}
}
if changed {
f.invalidateCFG()
}
}
}
......@@ -207,7 +210,6 @@ func fuseBlockPlain(b *Block) bool {
if f.Entry == b {
f.Entry = c
}
f.invalidateCFG()
// trash b, just in case
b.Kind = BlockInvalid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment