| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -mstrict-align" } */ |
| 3 |
|
| 4 |
struct s { char x[255]; }; |
| 5 |
void foo (struct s *); |
| 6 |
void bar (void) { struct s s1 = {}; foo (&s1); } |
| 7 |
|
| 8 |
/* memset (s1 = {}, sizeof = 255) should be expanded out |
| 9 |
such that there are no overlap stores when -mstrict-align |
| 10 |
is in use. |
| 11 |
so 7 pairs of 16 bytes stores (224 bytes). |
| 12 |
1 16 byte stores |
| 13 |
1 8 byte store |
| 14 |
1 4 byte store |
| 15 |
1 2 byte store |
| 16 |
1 1 byte store |
| 17 |
*/ |
| 18 |
|
| 19 |
/* { dg-final { scan-assembler-times "stp\tq" 7 } } */ |
| 20 |
/* { dg-final { scan-assembler-times "str\tq" 1 } } */ |
| 21 |
/* { dg-final { scan-assembler-times "str\txzr" 1 } } */ |
| 22 |
/* { dg-final { scan-assembler-times "str\twzr" 1 } } */ |
| 23 |
/* { dg-final { scan-assembler-times "strh\twzr" 1 } } */ |
| 24 |
/* { dg-final { scan-assembler-times "strb\twzr" 1 } } */ |
| 25 |
|
| 26 |
/* Also one store pair for the frame-pointer and the LR. */ |
| 27 |
/* { dg-final { scan-assembler-times "stp\tx" 1 } } */ |
| 28 |
|