1 /* { dg-require-effective-target vect_int } */
19 struct s a
; /* array a.n is unaligned */
22 struct s e
; /* array e.n is aligned */
26 struct s2 a
; /* array a.n is unaligned */
29 struct s2 e
; /* array e.n is aligned */
36 __attribute__ ((noinline
))
41 /* 1. unaligned (known misalignment) */
42 for (i
= 0; i
< N
; i
++)
44 tmp1
[2].a
.n
[1][2][i
] = 5;
48 for (i
= 0; i
<N
; i
++)
50 if (tmp1
[2].a
.n
[1][2][i
] != 5)
55 for (i
= 3; i
< N
-1; i
++)
57 tmp1
[2].a
.n
[1][2][i
] = 6;
61 for (i
= 3; i
< N
-1; i
++)
63 if (tmp1
[2].a
.n
[1][2][i
] != 6)
68 for (i
= 0; i
< N
; i
++)
70 for (j
= 0; j
< N
; j
++)
72 tmp1
[2].e
.n
[1][i
][j
] = 8;
77 for (i
= 0; i
< N
; i
++)
79 for (j
= 0; j
< N
; j
++)
81 if (tmp1
[2].e
.n
[1][i
][j
] != 8)
86 /* 4. unaligned (unknown misalignment) */
87 for (i
= 0; i
< N
-4; i
++)
89 for (j
= 0; j
< N
-4; j
++)
91 tmp2
[2].e
.n
[1][i
][j
] = 8;
96 for (i
= 0; i
< N
-4; i
++)
98 for (j
= 0; j
< N
-4; j
++)
100 if (tmp2
[2].e
.n
[1][i
][j
] != 8)
115 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
116 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
117 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vector_alignment_reachable} } } } */
118 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
119 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
120 /* { dg-final { cleanup-tree-dump "vect" } } */