| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fdump-tree-einline" } */ |
| 3 |
|
| 4 |
/* PR ipa/119599 */ |
| 5 |
/* inlining a noreturn function which returns |
| 6 |
can cause an ICE when dealing finding an unreachable block. |
| 7 |
We should get a __builtin_unreachable after the inliing. */ |
| 8 |
|
| 9 |
|
| 10 |
void baz (void); |
| 11 |
|
| 12 |
static inline __attribute__((always_inline, noreturn)) void |
| 13 |
bar (void) |
| 14 |
{ |
| 15 |
static volatile int t = 0; |
| 16 |
if (t == 0) |
| 17 |
baz (); |
| 18 |
} /* { dg-warning "function does return" } */ |
| 19 |
|
| 20 |
void |
| 21 |
foo (void) |
| 22 |
{ |
| 23 |
bar (); |
| 24 |
} |
| 25 |
|
| 26 |
/* After inlining, we should have call to __builtin_unreachable now. */ |
| 27 |
/* { dg-final { scan-tree-dump "__builtin_unreachable " "einline" } } */ |