111
|
1 /* { dg-require-effective-target vect_int } */
|
|
2
|
|
3 #include <stdarg.h>
|
|
4 #include "tree-vect.h"
|
|
5
|
|
6 #define N 128
|
|
7
|
|
8 __attribute__ ((noinline))
|
|
9 int main1 ()
|
|
10 {
|
|
11 union {
|
|
12 unsigned char a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
|
|
13 unsigned char b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
|
|
14 } s;
|
|
15 int i;
|
|
16
|
|
17 /* Initialization. */
|
|
18 for (i = 0; i < N; i++)
|
|
19 {
|
|
20 s.b[i] = i;
|
|
21 }
|
|
22
|
|
23 /* Dependence analysis fails cause s.a and s.b may overlap.
|
|
24 Try to use runtime aliasing test with versioning, and
|
|
25 later versioning/vectorization are skipped because the
|
|
26 overlap is proven at compilation time. */
|
|
27 for (i = 0; i < N; i++)
|
|
28 {
|
|
29 s.a[i] = s.b[i] + 1;
|
|
30 }
|
|
31
|
|
32 /* check results: */
|
|
33 for (i = 0; i < N; i++)
|
|
34 {
|
|
35 if (s.a[i] != i + 1)
|
|
36 abort ();
|
|
37 }
|
|
38
|
|
39 return 0;
|
|
40 }
|
|
41
|
|
42 int main (void)
|
|
43 {
|
|
44 check_vect ();
|
|
45
|
|
46 return main1 ();
|
|
47 }
|
|
48
|
|
49
|
|
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ia64-*-* sparc*-*-* } } } } */
|
|
51 /* { dg-final { scan-tree-dump "can't determine dependence between" "vect" } } */
|