testsuite: Revert to the original version of pr100056.c
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-vfa-vect-37.c
blob347af57b7c69e55ebaee08fb163336a97e23bde5
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "--param vect-max-version-for-alias-checks=0" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
8 char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9 char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
11 __attribute__ ((noinline))
12 int main1 (char *y)
14 struct {
15 char *p;
16 char *q;
17 } s;
18 int i;
20 /* Not vectorized - can't antialias the pointer s.p from the array cb. */
21 s.p = y;
22 for (i = 0; i < N; i++)
24 s.p[i] = cb[i];
27 /* check results: */
28 #pragma GCC novector
29 for (i = 0; i < N; i++)
31 if (s.p[i] != cb[i])
32 abort ();
35 /* Not vectorized - can't antialias the pointer s.p from the pointer s.q. */
36 s.q = cb;
37 for (i = 0; i < N; i++)
39 s.p[i] = s.q[i];
42 /* check results: */
43 #pragma GCC novector
44 for (i = 0; i < N; i++)
46 if (s.p[i] != s.q[i])
47 abort ();
50 return 0;
53 int main (void)
55 check_vect ();
57 return main1 (x);
60 /* Currently the loops fail to vectorize due to aliasing problems.
61 If/when the aliasing problems are resolved, unalignment may
62 prevent vectorization on some targets. */
63 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */
64 /* { dg-final { scan-tree-dump-times "can't determine dependence" 2 "vect" { target { ! vect_multiple_sizes } } } } */
65 /* { dg-final { scan-tree-dump "can't determine dependence" "vect" { target vect_multiple_sizes } } } */