2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-91.c
blobc5aee4403f2d31c7b53125e29fa1500475f62faa
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 "Vectorizing an unaligned access" 6 "vect" { target vect_hw_misalign } } } */
62 /* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" } } */
63 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
64 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
65 /* { dg-final { cleanup-tree-dump "vect" } } */