https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81511
Bug ID: 81511 Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu in operator[], at vec.h:749 Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The following valid code causes an ICE when compiled with the current gcc trunk at only -O3 on x86_64-linux-gnu. $ gcc-trunk --version gcc-trunk (GCC) 8.0.0 20170721 (experimental) [trunk revision 250425] $ gcc-trunk -O3 abc.c during GIMPLE pass: vect abc.c: In function ‘fn1’: abc.c:3:6: internal compiler error: in operator[], at vec.h:749 void fn1() { ^~~ 0x7624ac vec<_stmt_vec_info*, va_heap, vl_embed>::operator[](unsigned int) ../../gcc/gcc/vec.h:749 0x7624ac vec<_stmt_vec_info*, va_heap, vl_ptr>::operator[](unsigned int) ../../gcc/gcc/vec.h:1234 0x7624ac vinfo_for_stmt ../../gcc/gcc/tree-vectorizer.h:800 0x765cc4 vinfo_for_stmt ../../gcc/gcc/tree-vect-loop.c:3165 0x765cc4 vect_is_simple_reduction ../../gcc/gcc/tree-vect-loop.c:3072 0xee2884 vect_force_simple_reduction(_loop_vec_info*, gimple*, bool*, bool) ../../gcc/gcc/tree-vect-loop.c:3298 0xee2cd7 vect_analyze_scalar_cycles_1 ../../gcc/gcc/tree-vect-loop.c:857 0xee4d4c vect_analyze_scalar_cycles ../../gcc/gcc/tree-vect-loop.c:934 0xee4d4c vect_analyze_loop_2 ../../gcc/gcc/tree-vect-loop.c:1930 0xee4d4c vect_analyze_loop(loop*, _loop_vec_info*) ../../gcc/gcc/tree-vect-loop.c:2405 0xef0bb2 vectorize_loops() ../../gcc/gcc/tree-vectorizer.c:669 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ cat abc.c int a, b, d, e; char c, f; void fn1() { for (; b; b = b + 5) { e = a; a = 1 | d; d = f < 0 ^ c; } }