| 1 |
/* PR tree-optimization/88709 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-require-effective-target store_merge } */ |
| 4 |
/* { dg-options "-O2 -fno-tree-vectorize -fno-ipa-icf -fdump-tree-store-merging-details" } */ |
| 5 |
/* { dg-final { scan-tree-dump-times "New sequence of \[24] stores to replace old one of 16 stores" 8 "store-merging" { target { i?86-*-* x86_64-*-* } } } } */ |
| 6 |
/* { dg-final { scan-tree-dump-times "New sequence of \[24] stores to replace old one of 6 stores" 1 "store-merging" { target { ! arm*-*-* } } } } */ |
| 7 |
|
| 8 |
typedef struct S { char data[16]; } S; |
| 9 |
void optimize_me (S); |
| 10 |
void optimize_me3 (S, S, S); |
| 11 |
|
| 12 |
void |
| 13 |
good () |
| 14 |
{ |
| 15 |
optimize_me ((S) { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }); |
| 16 |
} |
| 17 |
|
| 18 |
void |
| 19 |
bad () |
| 20 |
{ |
| 21 |
optimize_me ((S) { 1, 2, 3, 4, 5 }); |
| 22 |
} |
| 23 |
|
| 24 |
void |
| 25 |
why () |
| 26 |
{ |
| 27 |
optimize_me ((S) { 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); |
| 28 |
} |
| 29 |
|
| 30 |
void |
| 31 |
srsly () |
| 32 |
{ |
| 33 |
optimize_me3 ((S) { 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 34 |
(S) { 11, 12, 13, 14, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, |
| 35 |
(S) { 21, 22, 23, 24, 25, 20, 20, 20, 10, 20, 20, 20, 20, 20, 20 }); |
| 36 |
} |
| 37 |
|
| 38 |
void |
| 39 |
srsly_not_one_missing () |
| 40 |
{ |
| 41 |
optimize_me3 ((S) { 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 42 |
(S) { 11, 12, 13, 14, 15, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 }, |
| 43 |
(S) { 21, 22, 23, 24, 25, 20, 20, 20, 10, 20, 20, 20, 20, 20, 20, 11 }); |
| 44 |
} |