Hi!

The operand can be not just SSA_NAME, but also gimple_is_min_invariant
and in that case we can ICE on the assert later on.
Example testcase is:
extern int c[64];

int
foo (int a)
{
  int x = a > 1;
  int y = &c[60] < (int *) 0x12345678UL;
  return x | y;
}
which is undefined behavior, so I'm not checking that in.

Fixed thusly, committed to trunk as obvious.

2011-10-03  Jakub Jelinek  <ja...@redhat.com>

        PR tree-optimization/50587
        * tree-ssa-reassoc.c (init_range_entry): Stop iterating when
        arg0 is not a SSA_NAME.

--- gcc/tree-ssa-reassoc.c.jj   2011-09-30 15:18:39.000000000 +0200
+++ gcc/tree-ssa-reassoc.c      2011-10-03 09:46:46.000000000 +0200
@@ -1648,6 +1648,8 @@ init_range_entry (struct range_entry *r,
 
       code = gimple_assign_rhs_code (stmt);
       arg0 = gimple_assign_rhs1 (stmt);
+      if (TREE_CODE (arg0) != SSA_NAME)
+       break;
       arg1 = gimple_assign_rhs2 (stmt);
       exp_type = TREE_TYPE (exp);
       loc = gimple_location (stmt);

        Jakub

Reply via email to