| 1 |
/* PR target/115961 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
|
| 4 |
struct e |
| 5 |
{ |
| 6 |
unsigned pre : 12; |
| 7 |
unsigned a : 4; |
| 8 |
}; |
| 9 |
|
| 10 |
static unsigned min_u (unsigned a, unsigned b) |
| 11 |
{ |
| 12 |
return (b < a) ? b : a; |
| 13 |
} |
| 14 |
|
| 15 |
__attribute__((noipa)) |
| 16 |
void bug (e * v, unsigned def, unsigned use) { |
| 17 |
e & defE = *v; |
| 18 |
defE.a = min_u (use + 1, 0xf); |
| 19 |
} |
| 20 |
|
| 21 |
__attribute__((noipa, optimize(0))) |
| 22 |
int main(void) |
| 23 |
{ |
| 24 |
e v = { 0xded, 3 }; |
| 25 |
|
| 26 |
bug(&v, 32, 33); |
| 27 |
|
| 28 |
if (v.a != 0xf) |
| 29 |
__builtin_abort (); |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |