http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58921
Bug ID: 58921 Summary: ICE with segfault on valid code at -O3 on x86_64-linux-gnu Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu 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 4.8.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/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --enable-languages=c,c++,objc,obj-c++,fortran,lto --disable-werror --enable-checking=none --with-gmp=/usr/local/gcc-trunk --with-mpfr=/usr/local/gcc-trunk --with-mpc=/usr/local/gcc-trunk --with-cloog=/usr/local/gcc-trunk --prefix=/usr/local/gcc-trunk Thread model: posix gcc version 4.9.0 20131029 (experimental) [trunk revision 204186] (GCC) $ $ gcc-trunk -O2 small.c $ gcc-4.8 -O3 small.c $ $ gcc-trunk -O3 small.c small.c: In function ‘fn1’: small.c:5:1: internal compiler error: Segmentation fault fn1 () ^ 0x81d4af crash_signal ../../gcc-trunk/gcc/toplev.c:334 0x967417 gimple_code ../../gcc-trunk/gcc/gimple.h:1222 0x967417 vect_get_vec_def_for_operand(tree_node*, gimple_statement_d*, tree_node**) ../../gcc-trunk/gcc/tree-vect-stmts.c:1438 0x9678e8 vect_get_vec_defs(tree_node*, tree_node*, gimple_statement_d*, vec<tree_node*, va_heap, vl_ptr>*, vec<tree_node*, va_heap, vl_ptr>*, _slp_tree*, int) ../../gcc-trunk/gcc/tree-vect-stmts.c:1627 0x96c267 vectorizable_operation ../../gcc-trunk/gcc/tree-vect-stmts.c:3779 0x972b64 vect_transform_stmt(gimple_statement_d*, gimple_stmt_iterator_d*, bool*, _slp_tree*, _slp_instance*) ../../gcc-trunk/gcc/tree-vect-stmts.c:5951 0x97711b vect_transform_loop(_loop_vec_info*) ../../gcc-trunk/gcc/tree-vect-loop.c:5880 0x98f4d6 vectorize_loops() ../../gcc-trunk/gcc/tree-vectorizer.c:373 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. $ $ ----------------------------------------- int a[7]; int b; void fn1 () { for (; b; b++) a[b] = ((a[b] <= 0) == (a[0] != 0)); } int main () { return 0; }