regehr@john-home:~/volatile/tmp44$ current-gcc -Os small.c small.c: In function ‘func_37’: small.c:10: internal compiler error: tree check: expected ssa_name, have integer_cst in get_value_range, at tree-vrp.c:612 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. regehr@john-home:~/volatile/tmp44$ current-gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion : (reconfigured) ../configure --program-prefix=current- --prefix=/home/regehr --enable-languages=c,c++ --no-create --no-recursion Thread model: posix gcc version 4.4.0 20080927 (experimental) (GCC) regehr@john-home:~/volatile/tmp44$ cat small.c typedef int uint16_t; typedef int uint32_t; uint32_t func_18 (uint16_t p_19) { return 1; } uint32_t func_37 (uint16_t p_38) { func_39 (+mod_rhs (func_18 (1) >= 1 ^ (div_rhs (1) || 0) || 0)), 1; }
Seen using r140721.
Reduced testcase: static int func_18 (void) { return 1; } int func_37 (int p_38) { return (func_18 () >= 1 ^ (div_rhs (1) || 0) || 0); } --- CUT --- Before VRP we have: D.1584_5 = 1 ^ D.1583_4; which is wrong, it should have been D.1583_4 ^ 1; I don't know why ccp did not create D.1581_4 ^ 1 but it created 1 ^ D.1581_4;
4.3 also produced the bad IR but 4.3's VRP did not ICE.
Subject: Bug 37662 Author: jakub Date: Tue Sep 30 17:00:49 2008 New Revision: 140792 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140792 Log: PR tree-optimization/37662 PR tree-optimization/37663 * tree-vrp.c (simplify_truth_ops_using_ranges): Don't call get_value_range with non-SSA_NAME. Don't assert operands have been folded, instead just bail out. * gcc.c-torture/compile/pr37662.c: New test. * gcc.dg/pr37663.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr37662.c trunk/gcc/testsuite/gcc.dg/pr37663.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vrp.c
Fixed.
Are you going to commit my tree-ssa-propagate.c patch separately, or should I wait for 4.5?
Subject: Bug 37662 Author: bonzini Date: Wed Oct 1 12:22:17 2008 New Revision: 140809 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140809 Log: 2008-09-30 Paolo Bonzini <bonzini@gnu.org> PR tree-optimization/37662 * tree-ssa-ccp.c (fold_gimple_assign): Invert the operands of a commutative binary operation if they are in the wrong order and fold_build2 produces non-GIMPLE. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-ccp.c