c++: wrong error due to std::initializer_list opt [PR116476]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-97-big-array.c
blob32b7d46711738d64a42364ecf89aef7c4ccfac57
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 128
9 char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10 char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
12 __attribute__ ((noinline))
13 int main1 ()
15 struct {
16 char *p;
17 char *q;
18 } s;
19 int i;
20 for (i = 0; i < N; i++)
22 cb[i] = i*3;
23 asm volatile ("" ::: "memory");
26 /* Check that datarefs analysis can determine that the access via pointer
27 s.p is based off array x, which enables us to antialias this access from
28 the access to array cb. */
29 s.p = x;
30 for (i = 0; i < N; i++)
32 s.p[i] = cb[i];
35 /* check results: */
36 #pragma GCC novector
37 for (i = 0; i < N; i++)
39 if (s.p[i] != cb[i])
40 abort ();
43 /* Check that datarefs analysis can determine that the access via pointer
44 s.p is based off array x, and that the access via pointer s.q is based off
45 array cb, which enables us to antialias these two accesses. */
46 s.q = cb;
47 for (i = 0; i < N; i++)
49 s.p[i] = s.q[i];
52 /* check results: */
53 #pragma GCC novector
54 for (i = 0; i < N; i++)
56 if (s.p[i] != s.q[i])
57 abort ();
60 return 0;
63 int main (void)
65 check_vect ();
67 return main1 ();
71 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
72 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
73 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */