diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2019-05-14 14:46:15 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2019-05-16 17:17:29 +0000 |
| commit | e7b7f874323bf105bebaf92db23fc4ba6f5c5257 (patch) | |
| tree | d330326e0653a17bab83ed5a16c778073525332e /src | |
| parent | 822a9f537fb49f56d405f265fa4d1d3e9ddc0531 (diff) | |
| download | go-e7b7f874323bf105bebaf92db23fc4ba6f5c5257.tar.xz | |
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: Keith Randall <khr@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/ssa/fuse.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/fuse.go b/src/cmd/compile/internal/ssa/fuse.go index c451904124..73532ee6e5 100644 --- a/src/cmd/compile/internal/ssa/fuse.go +++ b/src/cmd/compile/internal/ssa/fuse.go @@ -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 |
