https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61917
Bug ID: 61917 Summary: ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913 Product: gcc Version: 4.10.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 and gcc 4.9 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.10.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 4.10.0 20140725 (experimental) [trunk revision 213036] (GCC) $ $ gcc-trunk -O2 -c small.c $ gcc-4.8 -O3 -c small.c $ $ gcc-trunk -O3 -c small.c small.c: In function ‘fn1’: small.c:4:1: internal compiler error: in vectorizable_reduction, at tree-vect-loop.c:4913 fn1 () ^ 0xb8eb3c vectorizable_reduction(gimple_statement_base*, gimple_stmt_iterator*, gimple_statement_base**, _slp_tree*) ../../gcc-trunk/gcc/tree-vect-loop.c:4913 0xb8144f vect_analyze_stmt(gimple_statement_base*, bool*, _slp_tree*) ../../gcc-trunk/gcc/tree-vect-stmts.c:7103 0xb8ccee vect_analyze_loop_operations ../../gcc-trunk/gcc/tree-vect-loop.c:1505 0xb8ccee vect_analyze_loop_2 ../../gcc-trunk/gcc/tree-vect-loop.c:1766 0xb8ccee vect_analyze_loop(loop*) ../../gcc-trunk/gcc/tree-vect-loop.c:1864 0xba50cf vectorize_loops() ../../gcc-trunk/gcc/tree-vectorizer.c:432 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. $ $ gcc-4.9 -O3 -c small.c small.c: In function ‘fn1’: small.c:4:1: internal compiler error: in vectorizable_reduction, at tree-vect-loop.c:4907 fn1 () ^ 0x9b6f35 vectorizable_reduction(gimple_statement_base*, gimple_stmt_iterator*, gimple_statement_base**, _slp_tree*) ../../gcc-4.9.0/gcc/tree-vect-loop.c:4907 0x9a94e8 vect_analyze_stmt(gimple_statement_base*, bool*, _slp_tree*) ../../gcc-4.9.0/gcc/tree-vect-stmts.c:7103 0x9b54e6 vect_analyze_loop_operations ../../gcc-4.9.0/gcc/tree-vect-loop.c:1505 0x9b54e6 vect_analyze_loop_2 ../../gcc-4.9.0/gcc/tree-vect-loop.c:1765 0x9b54e6 vect_analyze_loop(loop*) ../../gcc-4.9.0/gcc/tree-vect-loop.c:1863 0x9c9f3b vectorize_loops() ../../gcc-4.9.0/gcc/tree-vectorizer.c:430 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, b, c, d; int fn1 () { for (; c; c++) for (b = 0; b < 2; b++) d = a - d; return d; }