| 1 |
/* PR tree-optimization/64322 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-vrp1" } */ |
| 4 |
|
| 5 |
extern void link_error (); |
| 6 |
extern void required_check (); |
| 7 |
|
| 8 |
long long int |
| 9 |
foo (long long int x) |
| 10 |
{ |
| 11 |
x >>= sizeof (long long int) * __CHAR_BIT__ - 1; |
| 12 |
if (x != 0 && x != -1) |
| 13 |
link_error (); |
| 14 |
return x; |
| 15 |
} |
| 16 |
|
| 17 |
unsigned long long int |
| 18 |
bar (unsigned long long int x) |
| 19 |
{ |
| 20 |
x >>= sizeof (long long int) * __CHAR_BIT__ - 1; |
| 21 |
if (x != 0 && x != 1) |
| 22 |
link_error (); |
| 23 |
return x; |
| 24 |
} |
| 25 |
|
| 26 |
long long int |
| 27 |
baz (long long int x) |
| 28 |
{ |
| 29 |
x = (x >> sizeof (long long int) * __CHAR_BIT__ - 1) << 1; |
| 30 |
x = x / 0x100000000LL; |
| 31 |
if (x != 0) |
| 32 |
link_error (); |
| 33 |
return x; |
| 34 |
} |
| 35 |
|
| 36 |
unsigned long long int |
| 37 |
range (unsigned long long int x, int y) |
| 38 |
{ |
| 39 |
y &= 3; |
| 40 |
x >>= sizeof (long long int) * __CHAR_BIT__ - 1 - y; |
| 41 |
if (x > 15) |
| 42 |
link_error (); |
| 43 |
if (x == 15) |
| 44 |
required_check (); |
| 45 |
return x; |
| 46 |
} |
| 47 |
|
| 48 |
/* { dg-final { scan-tree-dump-not "link_error" "vrp1" } } */ |
| 49 |
/* { dg-final { scan-tree-dump "required_check" "vrp1" } } */ |