| 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 |
char cb[N]; |
| 11 |
char ca[N]; |
| 12 |
|
| 13 |
__attribute__ ((noinline)) |
| 14 |
int main1 () |
| 15 |
{ |
| 16 |
int i; |
| 17 |
|
| 18 |
for (i = 0; i < N; i++) |
| 19 |
{ |
| 20 |
cb[i] = i*3; |
| 21 |
asm volatile ("" ::: "memory"); |
| 22 |
} |
| 23 |
|
| 24 |
for (i = 0; i < N; i++) |
| 25 |
{ |
| 26 |
ca[i] = cb[i]; |
| 27 |
} |
| 28 |
|
| 29 |
/* check results: */ |
| 30 |
#pragma GCC novector |
| 31 |
for (i = 0; i < N; i++) |
| 32 |
{ |
| 33 |
if (ca[i] != cb[i]) |
| 34 |
abort (); |
| 35 |
} |
| 36 |
|
| 37 |
return 0; |
| 38 |
} |
| 39 |
|
| 40 |
int main (void) |
| 41 |
{ |
| 42 |
check_vect (); |
| 43 |
|
| 44 |
return main1 (); |
| 45 |
} |
| 46 |
|
| 47 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ |
| 48 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ |
| 49 |
/* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */ |