]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/vect/vect-106.c
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
10 static int a
[N
] = {1,2,3,4,5,6,7,8,9};
11 static int b
[N
] = {2,3,4,5,6,7,8,9,0};
13 __attribute__ ((noinline
))
17 p
= (unsigned int *) malloc (sizeof (unsigned int) * N
);
18 q
= (unsigned int *) malloc (sizeof (unsigned int) * N
);
22 /* Vectorizable, before pointer plus we would get a redundant cast
23 (caused by pointer arithmetics), alias analysis fails to distinguish
24 between the pointers. */
25 for (i
= 0; i
< N
; i
++)
32 for (i
= 0; i
< N
; i
++)
34 if (*q
!= a
[i
] || *p
!= b
[i
])
43 for (i
= 0; i
< N
; i
++)
54 for (i
= 0; i
< N
; i
++)
56 if (*q
!= b
[i
] || *p
!= a
[i
])
72 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
74 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */