https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78224
Bug ID: 78224
Summary: ICE at -O2(-O1 on gcc6) and above in
verify_loop_structure, at cfgloop.c:1646
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rimvydas.jas at gmail dot com
Target Milestone: ---
Created attachment 39972
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39972&action=edit
bare minimum testcase, to show ICE
Attached is reduced testcase of failing voxelands port compilation.
$ g++-trunk -v
Reading specs from /zzz/gcc/gcc_git/build/gcc/specs
COLLECT_GCC=/zzz/gcc/gcc_git/build/gcc/xg++
COLLECT_LTO_WRAPPER=/zzz/gcc/gcc_git/build/gcc/lto-wrapper
Target: x86_64-unknown-dragonfly4.7
Configured with: ../configure --enable-bootstrap --disable-multilib
--disable-nls --enable-gnu-indirect-function
--enable-languages=c,c++,fortran,lto,objc --enable-threads=posix
--enable-libquadmath --with-system-zlib --with-as=/usr/local/bin/as
--with-ld=/usr/local/bin/ld --disable-libgcj --disable-libcilkrts
Thread model: posix
gcc version 7.0.0 20161106 (experimental) [trunk revision
ddd81c4:9ac4416:5055cc9834c33b5a7b9ec57194454c9b558dbf25] (GCC)
$ g++-trunk -c testcase6.cpp -O1
$ g++-trunk -c testcase6.cpp -O2
testcase6.cpp: In function 'void the_game(float)':
testcase6.cpp:35:6: error: loop with header 3 not in loop tree
void the_game(float turn_amount)
^~~~~~~~
testcase6.cpp:35:6: internal compiler error: in verify_loop_structure, at
cfgloop.c:1646
0x9660c7 verify_loop_structure()
../../gcc/cfgloop.c:1646
0xbf1121 checking_verify_loop_structure
../../gcc/cfgloop.h:611
0xbf1121 loop_optimizer_init(unsigned int)
../../gcc/loop-init.c:128
0xefd2ba tree_ssa_cs_elim
../../gcc/tree-ssa-phiopt.c:116
0xefd2ba execute
../../gcc/tree-ssa-phiopt.c:2500
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Exact same ICE happen with gcc5 -O2 and gcc6 -01.
_# /usr/local/gcc6-aux/bin/g++ -c testcase6.cpp
_# /usr/local/gcc6-aux/bin/g++ -c testcase6.cpp -O1
testcase6.cpp: In function 'void the_game(float)':
testcase6.cpp:35:6: internal compiler error: Segmentation fault
void the_game(float turn_amount)
^~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
gcc6 behaves the same on Arch linux(gcc version 6.2.1 20160830 (GCC)).