| 1 |
/* Disabling epilogues until we find a better way to deal with scans. */ |
| 2 |
/* { dg-additional-options "--param vect-epilogues-nomask=0 -fdump-tree-optimized-details-blocks" } */ |
| 3 |
/* { dg-require-effective-target vect_int } */ |
| 4 |
/* { dg-add-options double_vectors } */ |
| 5 |
|
| 6 |
#include <stdarg.h> |
| 7 |
#include "tree-vect.h" |
| 8 |
|
| 9 |
#if VECTOR_BITS > 256 |
| 10 |
#define N (VECTOR_BITS * 2 / 32) |
| 11 |
#else |
| 12 |
#define N 16 |
| 13 |
#endif |
| 14 |
|
| 15 |
struct tmp |
| 16 |
{ |
| 17 |
int x; |
| 18 |
int ia[N]; |
| 19 |
}; |
| 20 |
|
| 21 |
__attribute__ ((noinline)) |
| 22 |
int main1 (int off) |
| 23 |
{ |
| 24 |
struct tmp sb[N]; |
| 25 |
struct tmp *pp = &sb[off]; |
| 26 |
int i, ib[N]; |
| 27 |
|
| 28 |
for (i = 0; i < N; i++) |
| 29 |
pp->ia[i] = ib[i]; |
| 30 |
|
| 31 |
/* check results: */ |
| 32 |
#pragma GCC novector |
| 33 |
for (i = 0; i < N; i++) |
| 34 |
{ |
| 35 |
if (pp->ia[i] != ib[i]) |
| 36 |
abort(); |
| 37 |
} |
| 38 |
|
| 39 |
return 0; |
| 40 |
} |
| 41 |
|
| 42 |
int main (void) |
| 43 |
{ |
| 44 |
check_vect (); |
| 45 |
|
| 46 |
return main1 (8); |
| 47 |
} |
| 48 |
|
| 49 |
/* The store is unaligned, the load is aligned. For targets that support unaligned |
| 50 |
loads, peel to align the store and generate an unaligned access for the load. |
| 51 |
For targets that don't support unaligned loads, version for the store. */ |
| 52 |
|
| 53 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 54 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && { ! vect_align_stack_vars } } xfail { ! vect_unaligned_possible } } } } */ |
| 55 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */ |
| 56 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */ |
| 57 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */ |
| 58 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |