| 1 |
/* Disabling epilogues until we find a better way to deal with scans. */ |
| 2 |
/* { dg-additional-options "--param vect-epilogues-nomask=0" } */ |
| 3 |
/* { dg-require-effective-target vect_int } */ |
| 4 |
|
| 5 |
#include <stdarg.h> |
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
#define N 32 |
| 9 |
|
| 10 |
int ia[8][5][N+2]; |
| 11 |
int ic[16][16][5][N+2]; |
| 12 |
|
| 13 |
__attribute__ ((noinline)) |
| 14 |
int main1 () |
| 15 |
{ |
| 16 |
int i, j; |
| 17 |
|
| 18 |
/* Multidimensional array. Aligned. */ |
| 19 |
for (i = 0; i < 16; i++) |
| 20 |
{ |
| 21 |
for (j = 0; j < N; j++) |
| 22 |
{ |
| 23 |
ia[2][6][j] = 5; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
/* check results: */ |
| 28 |
for (i = 0; i < 16; i++) |
| 29 |
{ |
| 30 |
#pragma GCC novector |
| 31 |
for (j = 0; j < N; j++) |
| 32 |
{ |
| 33 |
if (ia[2][6][j] != 5) |
| 34 |
abort(); |
| 35 |
} |
| 36 |
} |
| 37 |
/* Multidimensional array. Aligned. */ |
| 38 |
for (i = 0; i < 16; i++) |
| 39 |
{ |
| 40 |
for (j = 0; j < N; j++) |
| 41 |
ia[3][6][j+2] = 5; |
| 42 |
} |
| 43 |
|
| 44 |
/* check results: */ |
| 45 |
for (i = 0; i < 16; i++) |
| 46 |
{ |
| 47 |
#pragma GCC novector |
| 48 |
for (j = 2; j < N+2; j++) |
| 49 |
{ |
| 50 |
if (ia[3][6][j] != 5) |
| 51 |
abort(); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
/* Multidimensional array. Not aligned. */ |
| 56 |
for (i = 0; i < 16; i++) |
| 57 |
{ |
| 58 |
for (j = 0; j < N; j++) |
| 59 |
{ |
| 60 |
ic[2][1][6][j+1] = 5; |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
/* check results: */ |
| 65 |
for (i = 0; i < 16; i++) |
| 66 |
{ |
| 67 |
#pragma GCC novector |
| 68 |
for (j = 0; j < N; j++) |
| 69 |
{ |
| 70 |
if (ic[2][1][6][j+1] != 5) |
| 71 |
abort(); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
return 0; |
| 76 |
} |
| 77 |
|
| 78 |
int main (void) |
| 79 |
{ |
| 80 |
check_vect (); |
| 81 |
|
| 82 |
return main1 (); |
| 83 |
} |
| 84 |
|
| 85 |
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ |
| 86 |
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ |
| 87 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { {! vect_aligned_arrays} && {vect_sizes_32B_16B} } } } } */ |
| 88 |
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {vect_aligned_arrays} && {! vect_sizes_32B_16B} } } } } */ |