| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fdump-tree-optimized" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ |
| 4 |
|
| 5 |
/* PR tree-optimization/117243 */ |
| 6 |
/* foo should be an infinite but sometimes it gets optimized incorrectly into |
| 7 |
an __builtin_unreachable(); which is not valid. */ |
| 8 |
void |
| 9 |
foo (unsigned int a, unsigned char b) |
| 10 |
{ |
| 11 |
lbl: |
| 12 |
for (b = 0; b <= 7; b++) |
| 13 |
{ |
| 14 |
unsigned char c[1][1]; |
| 15 |
int i, j; |
| 16 |
for (i = 0; i < 1; i++) |
| 17 |
for (j = 0; j < 1; j++) |
| 18 |
c[i][j] = 1; |
| 19 |
if (b) |
| 20 |
goto lbl; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
int |
| 25 |
main () |
| 26 |
{ |
| 27 |
foo (1, 2); |
| 28 |
} |
| 29 |
|
| 30 |
/* { dg-final { scan-tree-dump-not "__builtin_unreachable " "optimized"} } */ |