| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-skip-if "" { powerpc*-*-darwin* } } */ |
| 3 |
/* { dg-options "-mdejagnu-cpu=power7 -O2 -ftree-vectorize -fno-tree-loop-distribute-patterns -fno-vect-cost-model -fdump-tree-vect-details" } */ |
| 4 |
/* { dg-require-effective-target powerpc_vsx } */ |
| 5 |
|
| 6 |
/* Taken from vect/vect-align-1.c. */ |
| 7 |
|
| 8 |
/* Compile time known misalignment. Cannot use loop peeling to align |
| 9 |
the store. */ |
| 10 |
|
| 11 |
#define N 16 |
| 12 |
|
| 13 |
struct foo { |
| 14 |
char x; |
| 15 |
int y[N]; |
| 16 |
} __attribute__((packed)); |
| 17 |
|
| 18 |
int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; |
| 19 |
|
| 20 |
__attribute__ ((noinline)) int |
| 21 |
main1 (struct foo * __restrict__ p) |
| 22 |
{ |
| 23 |
int i; |
| 24 |
|
| 25 |
for (i = 0; i < N; i++) |
| 26 |
{ |
| 27 |
p->y[i] = x[i]; |
| 28 |
} |
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ |
| 33 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" } } */ |
| 34 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |