https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66185
Bug ID: 66185 Summary: ICE on valid code at -O3 on x86_64-linux-gnu Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- The following code causes an ICE when compiled with the current gcc trunk at -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. It is a regression from 5.1.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 6.0.0 20150517 (experimental) [trunk revision 223265] (GCC) $ $ gcc-trunk -O2 small.c; ./a.out $ gcc-5.1 -O3 small.c; ./a.out $ $ gcc-trunk -O3 small.c small.c: In function ‘main’: small.c:5:1: internal compiler error: Segmentation fault main () ^ 0xacd85f crash_signal ../../gcc-trunk/gcc/toplev.c:380 0xd066c8 vec<gimple_statement_base*, va_heap, vl_embed>::operator[](unsigned int) ../../gcc-trunk/gcc/vec.h:736 0xd066c8 vec<gimple_statement_base*, va_heap, vl_ptr>::operator[](unsigned int) ../../gcc-trunk/gcc/vec.h:1202 0xd066c8 vect_analyze_slp_instance ../../gcc-trunk/gcc/tree-vect-slp.c:1805 0xd07606 vect_analyze_slp(_loop_vec_info*, _bb_vec_info*, unsigned int) ../../gcc-trunk/gcc/tree-vect-slp.c:1897 0xd07ad6 vect_slp_analyze_bb_1 ../../gcc-trunk/gcc/tree-vect-slp.c:2431 0xd07ad6 vect_slp_analyze_bb(basic_block_def*) ../../gcc-trunk/gcc/tree-vect-slp.c:2561 0xd09e42 execute ../../gcc-trunk/gcc/tree-vectorizer.c:662 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. $ ------------------------------------ unsigned int a; int b[5], c; int main () { for (c = 0; c < 4; c++) b[c] = b[c+1] > ((b[0] > 0) > a); return 0; }