Commit 43b1bad6 by Richard Biener Committed by Richard Biener

re PR tree-optimization/55011 (GCC in an infinite loop at -O2 in VRP)

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.

	* gcc.dg/torture/pr55011.c: New testcase.

From-SVN: r192689
parent e81bf2ce
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.
......
/* { 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(;;);
}
}
......@@ -819,8 +819,19 @@ update_value_range (const_tree var, value_range_t *new_vr)
|| !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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment