| 1 |
/* { dg-do compile { target int128 } } */ |
| 2 |
/* { dg-options "-O -std=c11" } */ |
| 3 |
/* { dg-final { scan-assembler-not {abort} } } */ |
| 4 |
|
| 5 |
/* The stack is 8 byte aligned which means GCC has to manually align a 16 byte |
| 6 |
aligned object. This is done by allocating not 16 but rather 24 bytes for |
| 7 |
variable X and then manually aligning a pointer inside the memory block. |
| 8 |
Validate this by ensuring that the if-statement is optimized out. */ |
| 9 |
|
| 10 |
void bar (_Atomic unsigned __int128 *ptr); |
| 11 |
|
| 12 |
void foo (void) { |
| 13 |
_Atomic unsigned __int128 x; |
| 14 |
unsigned long n = (unsigned long)&x; |
| 15 |
if (n % 16 != 0) |
| 16 |
__builtin_abort (); |
| 17 |
bar (&x); |
| 18 |
} |