This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix ICE in init_range_entry (PR tree-optimization/50587)


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  <jakub@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]