Skip to content

Commit e7b7f87

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 822a9f5 commit e7b7f87

File tree

1 file changed

+3
-1
lines changed
  • src/cmd/compile/internal/ssa

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ func fuse(f *Func, typ fuseType) {
3636
changed = fuseBlockPlain(b) || changed
3737
}
3838
}
39+
if changed {
40+
f.invalidateCFG()
41+
}
3942
}
4043
}
4144

@@ -207,7 +210,6 @@ func fuseBlockPlain(b *Block) bool {
207210
if f.Entry == b {
208211
f.Entry = c
209212
}
210-
f.invalidateCFG()
211213

212214
// trash b, just in case
213215
b.Kind = BlockInvalid

0 commit comments

Comments
 (0)