| 1 |
/* PR tree-optimization/61839. */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-vrp1 -fdisable-tree-evrp -fdump-tree-optimized" } */ |
| 4 |
/* { dg-require-effective-target int32plus } */ |
| 5 |
|
| 6 |
__attribute__ ((noinline)) |
| 7 |
int foo (int a, unsigned b) |
| 8 |
{ |
| 9 |
unsigned c = 1; |
| 10 |
if (b >= 1 && b <= ((unsigned)(-1) - 1)) |
| 11 |
return 0; |
| 12 |
c = b >> 4; |
| 13 |
if (c == 268435455) |
| 14 |
; |
| 15 |
else |
| 16 |
__builtin_abort (); |
| 17 |
return 0; |
| 18 |
} |
| 19 |
|
| 20 |
int main () |
| 21 |
{ |
| 22 |
volatile unsigned b = (unsigned)(-1); |
| 23 |
foo (-1, b); |
| 24 |
} |
| 25 |
|
| 26 |
/* Scan for ~[1, 4294967294] >> 4 in function foo. */ |
| 27 |
/* { dg-final { scan-tree-dump-times "0 : 268435455" 1 "vrp1" } } */ |
| 28 |
/* { dg-final { scan-tree-dump-times "268435455" 0 "optimized" } } */ |