gcc/testsuite/gcc.c-torture/execute/pr57344-1.c
raw| 1 | /* PR middle-end/57344 */ |
| 2 | |
| 3 | struct __attribute__((packed)) S |
| 4 | { |
| 5 | int a : 11; |
| 6 | #if __SIZEOF_INT__ * __CHAR_BIT__ >= 32 |
| 7 | int b : 22; |
| 8 | #else |
| 9 | int b : 13; |
| 10 | #endif |
| 11 | char c; |
| 12 | int : 0; |
| 13 | } s[2]; |
| 14 | int i; |
| 15 | |
| 16 | __attribute__((noinline, noclone)) void |
| 17 | foo (int x) |
| 18 | { |
| 19 | if (x != -3161) |
| 20 | __builtin_abort (); |
| 21 | asm volatile ("" : : : "memory"); |
| 22 | } |
| 23 | |
| 24 | int |
| 25 | main () |
| 26 | { |
| 27 | struct S t = { 0, -3161L }; |
| 28 | s[1] = t; |
| 29 | for (; i < 1; i++) |
| 30 | foo (s[1].b); |
| 31 | return 0; |
| 32 | } |