Do not call range_of_ssa_name_with_loop_info with the loop tree root.
gcc/ChangeLog: PR tree-optimization/97396 * gimple-range.cc (gimple_ranger::range_of_phi): Do not call range_of_ssa_name_with_loop_info with the loop tree root. gcc/testsuite/ChangeLog: * gcc.dg/pr97396.c: New test.
This commit is contained in:
parent
ea9535e75e
commit
a121715bca
@ -490,7 +490,7 @@ gimple_ranger::range_of_phi (irange &r, gphi *phi)
|
||||
{
|
||||
value_range loop_range;
|
||||
class loop *l = loop_containing_stmt (phi);
|
||||
if (l)
|
||||
if (l && loop_outer (l))
|
||||
{
|
||||
range_of_ssa_name_with_loop_info (loop_range, phi_def, l, phi);
|
||||
if (!loop_range.varying_p ())
|
||||
|
23
gcc/testsuite/gcc.dg/pr97396.c
Normal file
23
gcc/testsuite/gcc.dg/pr97396.c
Normal file
@ -0,0 +1,23 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-O1 -ftree-vrp" }
|
||||
// { dg-additional-options "-m32" { target { i?86-*-* x86_64-*-* } } }
|
||||
|
||||
unsigned int
|
||||
po (char *os, unsigned int al)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
int qx = 0;
|
||||
|
||||
while (al < 1)
|
||||
{
|
||||
char *cw;
|
||||
|
||||
cw = os + qx;
|
||||
if (cw)
|
||||
return al + qx;
|
||||
|
||||
qx += sizeof *cw;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user