Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-peel-1-src.c

raw
1 #include <stdarg.h>
2 #include "tree-vect.h"
3
4 #define N 128
5
6 int ib[N+7];
7
8 __attribute__ ((noinline))
9 int main1 ()
10 {
11 int i;
12 int ia[N+1];
13
14 /* All the accesses are misaligned. With cost model disabled, we
15 count the number of aligned accesses for each peeling option, and
16 in this case we align the two loads if possible (i.e., if
17 misaligned stores are supported). */
18 for (i = 1; i <= N; i++)
19 {
20 ia[i] = ib[i+2] + ib[i+6];
21 }
22
23 /* check results: */
24 #pragma GCC novector
25 for (i = 1; i <= N; i++)
26 {
27 if (ia[i] != ib[i+2] + ib[i+6])
28 abort ();
29 }
30
31 return 0;
32 }
33
34 int main (void)
35 {
36 int i;
37
38 check_vect ();
39
40 for (i = 0; i <= N+6; i++)
41 {
42 asm volatile ("" : "+r" (i));
43 ib[i] = i;
44 }
45
46 return main1 ();
47 }
48
49