comparison gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options bind_pic_locally } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 64
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 struct s tmp;
23 __attribute__ ((noinline))
24 int main1 ()
25 {
26 int i;
27
28 /* unaligned */
29 for (i = 0; i < N/2; i++)
30 {
31 tmp.b[i] = 5;
32 }
33
34 /* check results: */
35 for (i = 0; i <N/2; i++)
36 {
37 if (tmp.b[i] != 5)
38 abort ();
39 }
40
41 /* aligned */
42 for (i = 0; i < N/2; i++)
43 {
44 tmp.c[i] = 6;
45 }
46
47 /* check results: */
48 for (i = 0; i <N/2; i++)
49 {
50 if (tmp.c[i] != 6)
51 abort ();
52 }
53
54 /* aligned */
55 for (i = 0; i < N/2; i++)
56 {
57 tmp.d.k[i] = 7;
58 }
59
60 /* check results: */
61 for (i = 0; i <N/2; i++)
62 {
63 if (tmp.d.k[i] != 7)
64 abort ();
65 }
66
67 /* unaligned */
68 for (i = 0; i < N/2; i++)
69 {
70 tmp.e.k[i] = 8;
71 }
72
73 /* check results: */
74 for (i = 0; i <N/2; i++)
75 {
76 if (tmp.e.k[i] != 8)
77 abort ();
78 }
79
80 return 0;
81 }
82
83 int main (void)
84 {
85 check_vect ();
86
87 return main1 ();
88 }
89
90 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
91 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
92 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */