| 1 |
/* PR tree-optimization/114040 */ |
| 2 |
/* { dg-do run { target { bitint && int128 } } } */ |
| 3 |
/* { dg-options "-std=c23" } */ |
| 4 |
/* { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } } */ |
| 5 |
/* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */ |
| 6 |
|
| 7 |
unsigned a; |
| 8 |
signed char b; |
| 9 |
short c; |
| 10 |
long d; |
| 11 |
__int128 e; |
| 12 |
int f; |
| 13 |
|
| 14 |
#if __BITINT_MAXWIDTH__ >= 511 |
| 15 |
__attribute__((noinline)) void |
| 16 |
foo (_BitInt(3) x, unsigned _BitInt(511) y, unsigned *z) |
| 17 |
{ |
| 18 |
int g = __builtin_sub_overflow_p (y ^ x, 0, (unsigned _BitInt(255)) 0); |
| 19 |
unsigned h = y + e, i = h + d; |
| 20 |
unsigned _BitInt(2) j = i + g; |
| 21 |
unsigned k = j + c; |
| 22 |
unsigned l = k + a + f + b; |
| 23 |
*z = l; |
| 24 |
} |
| 25 |
#endif |
| 26 |
|
| 27 |
int |
| 28 |
main () |
| 29 |
{ |
| 30 |
#if __BITINT_MAXWIDTH__ >= 511 |
| 31 |
unsigned x; |
| 32 |
foo (0, 0x81e4a5fa7c408f370000000000000000uwb, &x); |
| 33 |
if (x) |
| 34 |
__builtin_abort (); |
| 35 |
#endif |
| 36 |
} |