http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59245
Bug ID: 59245 Summary: ICE on valid code at -O3 on x86_64-linux-gnu in set_value_range, at tree-vrp.c:443 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). This 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 --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 4.9.0 20131121 (experimental) [trunk revision 205234] (GCC) $ $ gcc-trunk -O2 -c small.c $ gcc-4.8.2 -O3 -c small.c $ $ gcc-trunk -O3 -c small.c small.c: In function ‘fn2’: small.c:18:1: internal compiler error: in set_value_range, at tree-vrp.c:443 fn2 () ^ 0xba89bc set_value_range ../../gcc-trunk/gcc/tree-vrp.c:443 0xbb913a extract_range_from_assert ../../gcc-trunk/gcc/tree-vrp.c:1749 0xbb913a extract_range_from_assignment ../../gcc-trunk/gcc/tree-vrp.c:3772 0xbba671 vrp_visit_assignment_or_call ../../gcc-trunk/gcc/tree-vrp.c:6742 0xbba671 vrp_visit_stmt ../../gcc-trunk/gcc/tree-vrp.c:7553 0xb00612 simulate_stmt ../../gcc-trunk/gcc/tree-ssa-propagate.c:324 0xb00bfd simulate_block ../../gcc-trunk/gcc/tree-ssa-propagate.c:447 0xb00bfd ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gimple_statement_base*)) ../../gcc-trunk/gcc/tree-ssa-propagate.c:854 0xbbb66b execute_vrp ../../gcc-trunk/gcc/tree-vrp.c:9710 0xbbb66b execute ../../gcc-trunk/gcc/tree-vrp.c:9801 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, e, g; char d[5], f; int fn1 () { if (b) { g = 0; return 0; } for (f = 0; f != 1; f--) ; return 0; } void fn2 () { d[4] = -1; for (a = 4; a; a--) { fn1 (); e = c < -2147483647 - 1 - d[a] ? c : 0; } }