gcc/testsuite/gcc.dg/pr123300.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -fdump-tree-vrp1" } */ |
| 3 | [[gnu::noipa]] void |
| 4 | bar (int a, int b) |
| 5 | { |
| 6 | if (a < 0) |
| 7 | __builtin_abort (); |
| 8 | } |
| 9 | |
| 10 | [[gnu::noipa]] void |
| 11 | foo (int n, bool p) |
| 12 | { |
| 13 | for (int i = n; i-- > 0;) |
| 14 | { |
| 15 | const int x = 1 << i; |
| 16 | if (x <= 0) |
| 17 | __builtin_unreachable (); |
| 18 | if (p) |
| 19 | bar (i, x); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | int |
| 24 | main () |
| 25 | { |
| 26 | foo (4, true); |
| 27 | } |
| 28 | /* { dg-final { scan-tree-dump "__builtin_unreachable" "vrp1" } } */ |
| 29 |