Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-91.c
blob75073632458d7572c22340024ce014bce6c2ff08
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 256
9 extern int a[N];
11 /* The alignment of 'pa' is unknown.
12 Yet we do know that both the read access and write access have
13 the same alignment. Peeling to align one of the accesses will
14 align the other. */
16 __attribute__ ((noinline)) int
17 main1 (int * pa)
19 int i;
21 for (i = 0; i < N; i++)
23 pa[i] = pa[i] + 1;
26 return 0;
29 /* The alignment of 'a' is unknown.
30 Yet we do know that both the read access and write access have
31 the same alignment. Peeling to align one of the accesses will
32 align the other. */
34 __attribute__ ((noinline)) int
35 main2 ()
37 int i;
39 for (i = 0; i < N; i++)
41 a[i] = a[i] + 1;
44 return 0;
47 __attribute__ ((noinline)) int
48 main3 ()
50 int i;
52 for (i = 0; i < N; i++)
54 a[i] = a[i+20];
57 return 0;
60 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
61 /* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" } } */
62 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target vector_alignment_reachable } } } */
63 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target {! vector_alignment_reachable} } } } */
64 /* { dg-final { cleanup-tree-dump "vect" } } */