| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fdump-tree-optimized" } */ |
| 3 |
/* PR tree-optimization/110941 */ |
| 4 |
/* The call to foo should be able to removed, |
| 5 |
VRP should figure out `(c >= 2 && c <= 26)` |
| 6 |
is always true. */ |
| 7 |
|
| 8 |
static int a; |
| 9 |
void foo(void); |
| 10 |
void bar349_(void); |
| 11 |
void bar363_(void); |
| 12 |
void bar275_(void); |
| 13 |
int main() { |
| 14 |
{ |
| 15 |
{ |
| 16 |
short b = 26; |
| 17 |
for (; b >= 1; b = b - 4) { |
| 18 |
if (b >= 2 && b <= 26) |
| 19 |
bar275_(); |
| 20 |
if (a) |
| 21 |
bar363_(); |
| 22 |
if (a) |
| 23 |
bar349_(); |
| 24 |
int c = b; |
| 25 |
if (!(c >= 2 && c <= 26)) |
| 26 |
foo(); |
| 27 |
} |
| 28 |
} |
| 29 |
a = 0; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
/* { dg-final { scan-tree-dump-not "foo " "optimized" } } */ |