Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / vect / vect-106-alias.c
blob011e7e4c2e7e0c82d11a1d7e8e9d14f80c7132aa
1 /* { dg-require-effective-target vect_int } */
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 9
9 static int a[N] = {1,2,3,4,5,6,7,8,9};
10 static int b[N] = {2,3,4,5,6,7,8,9,0};
12 int main1 () {
13 int i;
14 int *p, *q, *p1, *q1;
15 p = (unsigned int *) malloc (sizeof (unsigned int) * N);
16 q = (unsigned int *) malloc (sizeof (unsigned int) * N);
18 p1 = p; q1 = q;
20 /* Not vectorizable: because of the redundant cast (caused by ponter
21 arithmetics), alias analysis fails to distinguish between
22 the pointers. */
23 for (i = 0; i < N; i++)
25 *(q + i) = a[i];
26 *(p + i) = b[i];
29 /* check results: */
30 for (i = 0; i < N; i++)
32 if (*q != a[i] || *p != b[i])
33 abort();
34 q++;
35 p++;
38 return 0;
41 int main (void)
43 check_vect ();
45 return main1 ();
48 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
49 /* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" } } */
50 /* { dg-final { cleanup-tree-dump "vect" } } */