| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-add-options bind_pic_locally } */ |
| 3 |
/* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */ |
| 4 |
|
| 5 |
#include <stdarg.h> |
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
#define N 128 |
| 9 |
|
| 10 |
int ic[N*2]; |
| 11 |
int ib[N]; |
| 12 |
|
| 13 |
#define ia (ic+N) |
| 14 |
|
| 15 |
__attribute__ ((noinline)) |
| 16 |
int main1 () |
| 17 |
{ |
| 18 |
int i, j; |
| 19 |
|
| 20 |
for (i = 0; i < N; i++) |
| 21 |
{ |
| 22 |
ib[i] = i*3; |
| 23 |
asm volatile ("" ::: "memory"); |
| 24 |
} |
| 25 |
|
| 26 |
for (i = 0; i < N; i++) |
| 27 |
{ |
| 28 |
ia[i] = ib[i]; |
| 29 |
} |
| 30 |
|
| 31 |
/* check results: */ |
| 32 |
#pragma GCC novector |
| 33 |
for (i = 0; i < N; i++) |
| 34 |
{ |
| 35 |
if (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 (); |
| 47 |
} |
| 48 |
|
| 49 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 50 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ |
| 51 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |