merge with trunk @ 139506
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-vfa-vect-37.c
blobbfa0802c0ced0e87a67fae491ea0b6b847b5d0bc
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 char x[N] __attribute__ ((__aligned__(16)));
8 char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
10 __attribute__ ((noinline))
11 int main1 (char *y)
13 struct {
14 char *p;
15 char *q;
16 } s;
17 int i;
19 /* Not vectorized - can't antialias the pointer s.p from the array cb. */
20 s.p = y;
21 for (i = 0; i < N; i++)
23 s.p[i] = cb[i];
26 /* check results: */
27 for (i = 0; i < N; i++)
29 if (s.p[i] != cb[i])
30 abort ();
33 /* Not vectorized - can't antialias the pointer s.p from the pointer s.q. */
34 s.q = cb;
35 for (i = 0; i < N; i++)
37 s.p[i] = s.q[i];
40 /* check results: */
41 for (i = 0; i < N; i++)
43 if (s.p[i] != s.q[i])
44 abort ();
47 return 0;
50 int main (void)
52 check_vect ();
54 return main1 (x);
57 /* Currently the loops fail to vectorize due to aliasing problems.
58 If/when the aliasing problems are resolved, unalignment may
59 prevent vectorization on some targets. */
60 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */
61 /* { dg-final { scan-tree-dump-times "can't determine dependence between" 2 "vect" } } */
62 /* { dg-final { cleanup-tree-dump "vect" } } */