https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61776
Bug ID: 61776
Summary: ICE: verify_flow_info failed: control flow in the
middle of basic block with -fprofile-generate
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: wmi at google dot com
CC: rguenth at gcc dot gnu.org
Host: x86_64-linux-gnu
Target: x86_64-linux-gnu
Build: x86_64-linux-gnu
Created attachment 33106
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33106&action=edit
testcase 1.c
~/workarea/gcc-r211604/build/install/bin/gcc -O2 -S -fprofile-generate 1.c
1.c: In function ‘foo’:
1.c:24:1: error: control flow in the middle of basic block 3
}
^
1.c:24:1: error: control flow in the middle of basic block 3
1.c:24:1: error: control flow in the middle of basic block 3
1.c:24:1: internal compiler error: verify_flow_info failed
0x71f8c2 verify_flow_info()
../../src/gcc/cfghooks.c:260
0xbdaf1b cleanup_tree_cfg_noloop
../../src/gcc/tree-cfgcleanup.c:737
0xbdafec cleanup_tree_cfg()
../../src/gcc/tree-cfgcleanup.c:786
0xc674b8 tree_profiling
../../src/gcc/tree-profile.c:652
0xc6754a execute
../../src/gcc/tree-profile.c:691
The cause of the problem is:
Before edge profiling instrumentation, goo in 1.c is regarded as a const
function since it has no side-effect, so during instrumentation call goo is not
regarded as a bb ending stmt, and some instrumentation code is inserted after
call goo in the same BB -- call goo stmt is in the middle of a BB now.
After edge profiling instrumentation, goo body now contains instrumentation
code, and goo's const flag is reset to false because now it has side-effect.
Since then call goo is regarded as a bb ending stmt, which is inconsistent with
the fact that call goo is in the middle of a BB. verify_flow_info() after that
fails and Error message "control flow in the middle of basic block" is
reported.
Google ref b/15936428