| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-additional-options "--param vect-max-version-for-alias-checks=0" } */ |
| 3 |
|
| 4 |
#include <stdlib.h> |
| 5 |
#include <stdarg.h> |
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
#define N 9 |
| 9 |
|
| 10 |
struct extraction |
| 11 |
{ |
| 12 |
int a[N]; |
| 13 |
int b[N]; |
| 14 |
}; |
| 15 |
|
| 16 |
static int a[N] = {1,2,3,4,5,6,7,8,9}; |
| 17 |
static int b[N] = {2,3,4,5,6,7,8,9,0}; |
| 18 |
|
| 19 |
__attribute__ ((noinline)) |
| 20 |
int main1 (int x, int y) { |
| 21 |
int i; |
| 22 |
struct extraction *p; |
| 23 |
p = (struct extraction *) malloc (sizeof (struct extraction)); |
| 24 |
|
| 25 |
/* Not vectorizable: different unknown offset. */ |
| 26 |
#pragma GCC unroll 0 |
| 27 |
for (i = 0; i < N; i++) |
| 28 |
{ |
| 29 |
*((int *)p + x + i) = a[i]; |
| 30 |
*((int *)p + y + i) = b[i]; |
| 31 |
} |
| 32 |
|
| 33 |
/* check results: */ |
| 34 |
#pragma GCC novector |
| 35 |
for (i = 0; i < N; i++) |
| 36 |
{ |
| 37 |
if (p->a[i] != a[i] || p->b[i] != b[i]) |
| 38 |
abort(); |
| 39 |
} |
| 40 |
return 0; |
| 41 |
} |
| 42 |
|
| 43 |
int main (void) |
| 44 |
{ |
| 45 |
check_vect (); |
| 46 |
|
| 47 |
return main1 (0, N); |
| 48 |
} |
| 49 |
|
| 50 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */ |
| 51 |
/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" { target { ! vect_multiple_sizes } } } } */ |
| 52 |
/* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */ |
| 53 |
|