https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71359
Bug ID: 71359 Summary: ICE at -Os and above in 32-bit and 64-bit modes on x86_64-linux-gnu (Segmentation fault, vec_safe_length<loop*, va_gc>) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Target Milestone: --- $: gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160531 (experimental) [trunk revision 236912] (GCC) $: gcc-trunk -w -O3 small.c small.c: In function ‘fn1’: small.c:3:6: internal compiler error: Segmentation fault void fn1() { ^~~ 0xbbd02f crash_signal ../../gcc-source-trunk/gcc/toplev.c:333 0xd08d70 vec_safe_length<loop*, va_gc> ../../gcc-source-trunk/gcc/vec.h:529 0xd08d70 loop_outer ../../gcc-source-trunk/gcc/cfgloop.h:456 0xd08d70 tree_unroll_loops_completely_1 ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1347 0xd08ce0 tree_unroll_loops_completely_1 ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1314 0xd08ce0 tree_unroll_loops_completely_1 ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1314 0xd09013 tree_unroll_loops_completely(bool, bool) ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1384 0xd09583 execute ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1593 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. $: cat small.c char a[]; int b; void fn1() { int i; for (;;) { i = 0; for (; i < 6; i++) { if (b) for (;;) ; int c = a[i]; printf("", i); } } } int main() {} $: