| 1 |
/* PR tree-optimization/49039 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-vrp1 -fno-thread-jumps" } */ |
| 4 |
|
| 5 |
extern void bar (void); |
| 6 |
|
| 7 |
void |
| 8 |
foo (unsigned int x, unsigned int y) |
| 9 |
{ |
| 10 |
unsigned int minv, maxv; |
| 11 |
if (x >= 3 && x <= 6) |
| 12 |
return; |
| 13 |
if (y >= 5 && y <= 8) |
| 14 |
return; |
| 15 |
minv = x < y ? x : y; |
| 16 |
maxv = x > y ? x : y; |
| 17 |
if (minv == 5) |
| 18 |
bar (); |
| 19 |
if (minv == 6) |
| 20 |
bar (); |
| 21 |
if (maxv == 5) |
| 22 |
bar (); |
| 23 |
if (maxv == 6) |
| 24 |
bar (); |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-tree-dump "Folding predicate minv_\[0-9\]* == 5 to 0" "vrp1" } } */ |
| 28 |
/* { dg-final { scan-tree-dump "Folding predicate minv_\[0-9\]* == 6 to 0" "vrp1" } } */ |
| 29 |
/* { dg-final { scan-tree-dump "Folding predicate maxv_\[0-9\]* == 5 to 0" "vrp1" } } */ |
| 30 |
/* { dg-final { scan-tree-dump "Folding predicate maxv_\[0-9\]* == 6 to 0" "vrp1" } } */ |