| 1 |
/* { dg-require-effective-target vect_int } */ |
| 2 |
/* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */ |
| 3 |
|
| 4 |
#include <stdarg.h> |
| 5 |
#include "tree-vect.h" |
| 6 |
|
| 7 |
#define N 16 |
| 8 |
|
| 9 |
__attribute__ ((noinline)) |
| 10 |
int main1 () |
| 11 |
{ |
| 12 |
int i, j; |
| 13 |
int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; |
| 14 |
int ia[N*2][4][N]; |
| 15 |
|
| 16 |
/* Multidimensional array. Aligned. |
| 17 |
The first dimension depends on j: use strided stores. */ |
| 18 |
for (i = 0; i < N; i++) |
| 19 |
{ |
| 20 |
for (j = 0; j < N; j++) |
| 21 |
{ |
| 22 |
ia[i + j][1][j] = ib[i]; |
| 23 |
} |
| 24 |
} |
| 25 |
|
| 26 |
/* check results: */ |
| 27 |
for (i = 0; i < N; i++) |
| 28 |
{ |
| 29 |
#pragma GCC novector |
| 30 |
for (j = 0; j < N; j++) |
| 31 |
{ |
| 32 |
if (ia[i + j][1][j] != ib[i]) |
| 33 |
abort(); |
| 34 |
} |
| 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-not "Invalid sum" "optimized" } } */ |