| 1 |
/* PR tree-optimization/113102 */ |
| 2 |
/* { dg-do compile { target bitint } } */ |
| 3 |
/* { dg-options "-std=c23 -O2" } */ |
| 4 |
|
| 5 |
_BitInt(3) a; |
| 6 |
#if __BITINT_MAXWIDTH__ >= 4097 |
| 7 |
_BitInt(8) b; |
| 8 |
_BitInt(495) c; |
| 9 |
_BitInt(513) d; |
| 10 |
_BitInt(1085) e; |
| 11 |
_BitInt(4096) f; |
| 12 |
|
| 13 |
void |
| 14 |
foo (void) |
| 15 |
{ |
| 16 |
a -= (_BitInt(4097)) d >> b; |
| 17 |
} |
| 18 |
|
| 19 |
void |
| 20 |
bar (void) |
| 21 |
{ |
| 22 |
__builtin_sub_overflow ((_BitInt(767)) c >> e, 0, &a); |
| 23 |
} |
| 24 |
|
| 25 |
void |
| 26 |
baz (void) |
| 27 |
{ |
| 28 |
_BitInt(768) x = (_BitInt(257))f; |
| 29 |
b /= x >> 0 / 0; /* { dg-warning "division by zero" } */ |
| 30 |
} |
| 31 |
#endif |