| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Os -fdump-tree-optimized" } */ |
| 3 |
/* PR tree-optimization/110768 */ |
| 4 |
/* The call to foo should be able to removed, |
| 5 |
The branch to unreachable is unreachable as |
| 6 |
VRP (ranger) figure out that c there can only |
| 7 |
be -20409 or 0. before r14-5109-ga291237b628f41 |
| 8 |
ranger could not figure that out. */ |
| 9 |
|
| 10 |
|
| 11 |
void foo(void); |
| 12 |
static int a, b; |
| 13 |
int main() { |
| 14 |
{ |
| 15 |
short c = 45127; |
| 16 |
signed char d; |
| 17 |
b = 0; |
| 18 |
for (; b <= 3; b++) { |
| 19 |
if (b) continue; |
| 20 |
d = 0; |
| 21 |
for (; d <= 100; d++) { |
| 22 |
if (!(((c) >= -20409) && ((c) <= 1))) { |
| 23 |
__builtin_unreachable(); |
| 24 |
} |
| 25 |
if (~(0 == a) & 1) return b; |
| 26 |
c = 0; |
| 27 |
for (; c <= 0; c++) a = 3; |
| 28 |
} |
| 29 |
} |
| 30 |
foo(); |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
/* { dg-final { scan-tree-dump-not "foo " "optimized" } } */ |