1 /* { dg-require-effective-target vect_int } */
6 short Kernshort
[24] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
7 static void VecBug(short Kernel
[8][24]) __attribute__((noinline
));
8 static void VecBug2(short Kernel
[8][24]) __attribute__((noinline
));
10 /* Kernel may alias Kernshort - a global array.
11 Use versioning for aliasing. */
12 static void VecBug(short Kernel
[8][24])
16 for (i
= 0; i
<24; i
++)
17 Kernshort
[i
] = Kernel
[k
][i
];
20 /* Vectorizable: Kernshort2 is local. */
21 static void VecBug2(short Kernel
[8][24])
24 short Kernshort2
[24] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
26 for (i
= 0; i
<24; i
++)
27 Kernshort2
[i
] = Kernel
[k
][i
];
30 for (i
= 0; i
<24; i
++)
31 if (Kernshort2
[i
] != Kernel
[k
][i
])
35 int main (int argc
, char **argv
)
39 short Kernel
[8][24] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
43 for (i
= 0; i
<24; i
++)
52 /* The loops in VecBug and VecBug2 require versioning for alignment.
53 The loop in main is aligned. */
54 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
55 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { target { vect_no_align && { ! vect_hw_misalign } } } } } */
56 /* { dg-final { cleanup-tree-dump "vect" } } */