mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 18:20:51 +08:00
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
This commit is contained in:
parent
e81bf2ce3b
commit
43b1bad65d
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
22
gcc/testsuite/gcc.dg/torture/pr55011.c
Normal file
22
gcc/testsuite/gcc.dg/torture/pr55011.c
Normal file
@ -0,0 +1,22 @@
|
||||
/* { 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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user