+2012-10-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55011
+ * tree-vrp.c (update_value_range): For invalid lattice transitions
+ drop to VARYING.
+
2012-10-22 Julian Brown <julian@codesourcery.com>
* config/arm/arm.h (CANNOT_CHANGE_MODE_CLASS): Avoid subreg'ing
+2012-10-22 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55011
+ * gcc.dg/torture/pr55011.c: New testcase.
+
2012-10-22 Greta Yorsh <Greta.Yorsh@arm.com>
* gcc.target/arm/pr40457-1.c: Adjust expected output.
--- /dev/null
+/* { dg-do compile } */
+
+char a;
+
+void f(void)
+{
+ char b = 2;
+
+ for(;;)
+ {
+ unsigned short s = 1, *p = &s, *i;
+
+ for(*i = 0; *i < 4; ++*i)
+ if(a | (*p /= (b += !!a)) <= 63739)
+ return;
+
+ if(!s)
+ a = 0;
+
+ for(;;);
+ }
+}
|| !vrp_bitmap_equal_p (old_vr->equiv, new_vr->equiv);
if (is_new)
- set_value_range (old_vr, new_vr->type, new_vr->min, new_vr->max,
- new_vr->equiv);
+ {
+ /* Do not allow transitions up the lattice. The following
+ is slightly more awkward than just new_vr->type < old_vr->type
+ because VR_RANGE and VR_ANTI_RANGE need to be considered
+ the same. We may not have is_new when transitioning to
+ UNDEFINED or from VARYING. */
+ if (new_vr->type == VR_UNDEFINED
+ || old_vr->type == VR_VARYING)
+ set_value_range_to_varying (old_vr);
+ else
+ set_value_range (old_vr, new_vr->type, new_vr->min, new_vr->max,
+ new_vr->equiv);
+ }
BITMAP_FREE (new_vr->equiv);