1 /* { dg-require-effective-target vect_int } */
19 __attribute__ ((noinline
))
23 p
= (struct extraction
*) malloc (sizeof (struct extraction
));
24 for (i
= 0; i
< N
; i
++)
26 for (j
= 0; j
< N
; j
++)
28 a
[i
][j
] = (i
*7 + j
*17)%53;
29 b
[i
][j
] = (i
*11+ j
*13)%41;
30 asm volatile ("" ::: "memory");
33 for (i
= 0; i
< N
; i
++)
35 for (j
= 0; j
< N
; j
++)
38 asm volatile ("" ::: "memory");
41 for (i
= 1; i
< N
; i
++)
43 for (j
= 0; j
< N
; j
++)
45 off
= x
+ i
+ j
+ N
+1;
46 if (x
+ i
+ j
> N
*N
-1)
49 *(&c
[0][0]+x
+i
+j
) = *(&b
[0][0] + off
- N
*N
);
51 *(&c
[0][0]+x
+i
+j
) = *(&a
[0][0] + off
);
52 asm volatile ("" ::: "memory");
56 for (i
= 0; i
< N
; i
++)
58 for (j
= 0; j
< N
; j
++)
62 asm volatile ("" ::: "memory");
66 /* Vectorizable: distance > number of iterations. */
67 for (i
= 1; i
< N
; i
++)
69 for (j
= 0; j
< N
; j
++)
71 *((int *)p
+ x
+ i
+ j
) = *((int *)p
+ x
+ i
+ j
+ N
+1);
76 for (i
= 0; i
< N
; i
++)
78 for (j
= 0; j
< N
; j
++)
80 if (p
->a
[i
][j
] != c
[i
][j
])
94 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
95 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
96 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 0 "vect" } } */