https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61384
Bug ID: 61384 Summary: ICE on valid code at -O3 on x86_64-linux-gnu Product: gcc Version: unknown 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.9.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 20140601 (experimental) [trunk revision 211115] (GCC) $ $ gcc-trunk -O2 small.c; a.out $ gcc-4.9.0 -O3 small.c; a.out $ $ gcc-trunk -O3 small.c small.c: In function ‘fn2’: small.c:11:1: internal compiler error: in check_probability, at basic-block.h:953 fn2 () ^ 0xb8f066 check_probability ../../gcc-trunk/gcc/basic-block.h:953 0xb8c78f check_probability ../../gcc-trunk/gcc/tree.h:2842 0xb8c78f combine_probabilities ../../gcc-trunk/gcc/basic-block.h:962 0xb8c78f slpeel_tree_peel_loop_to_edge ../../gcc-trunk/gcc/tree-vect-loop-manip.c:1371 0xb8cbd4 vect_do_peeling_for_loop_bound(_loop_vec_info*, tree_node*, tree_node*, unsigned int, bool) ../../gcc-trunk/gcc/tree-vect-loop-manip.c:1761 0xb7dba6 vect_transform_loop(_loop_vec_info*) ../../gcc-trunk/gcc/tree-vect-loop.c:5852 0xb9ac16 vectorize_loops() ../../gcc-trunk/gcc/tree-vectorizer.c:476 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, d, e, g, h; static int c = 1, f[5]; int fn1 (int p1, int p2) { return p1 && p2 && p2; } void fn2 () { for (d = 0; d < 1; d++) { g = f[0]; e = 0; h = fn1 (1, (a && c) ^ b); } for (; e < 5; e++) f[e] = 1; } int main () { fn2 (); return 0; }