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