Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fno-tree-loop-distribute-patterns" } */
3
4 #include <stdarg.h>
5 #include "../../tree-vect.h"
6
7 #define N 32
8
9 struct t{
10 int k[N];
11 int l;
12 };
13
14 struct s{
15 char a; /* aligned */
16 char b[N-1]; /* unaligned (offset 1B) */
17 char c[N]; /* aligned (offset NB) */
18 struct t d; /* aligned (offset 2NB) */
19 struct t e; /* unaligned (offset 2N+4N+4 B) */
20 };
21
22 int main1 ()
23 {
24 int i;
25 struct s tmp;
26
27 /* unaligned */
28 for (i = 0; i < N/2; i++)
29 {
30 tmp.b[i] = 5;
31 }
32
33 /* check results: */
34 #pragma GCC novector
35 for (i = 0; i <N/2; i++)
36 {
37 if (tmp.b[i] != 5)
38 abort ();
39 }
40
41 return 0;
42 }
43
44 int main (void)
45 {
46 check_vect ();
47
48 return main1 ();
49 }
50
51 /* { dg-final { scan-tree-dump-times "unsupported unaligned access" 1 "vect" { target { ! vect_hw_misalign } } } } */
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { target { ! vect_hw_misalign } } } } */