Debian Codegraph @

gcc/testsuite/gcc.dg/vect/slp-25.c

raw
1 /* Disabling epilogues until we find a better way to deal with scans. */
2 /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
3 /* { dg-require-effective-target vect_int } */
4 /* { dg-add-options bind_pic_locally } */
5
6 #include <stdarg.h>
7 #include "tree-vect.h"
8
9 #define N 128
10
11 /* Unaligned stores. */
12
13 int ia[N+2];
14 short sa[N+2];
15
16 int main1 (int n)
17 {
18 int i;
19
20 for (i = 1; i <= N/2; i++)
21 {
22 ia[2*i] = 25;
23 ia[2*i + 1] = 5;
24 }
25
26 /* check results: */
27 #pragma GCC novector
28 for (i = 1; i <= N/2; i++)
29 {
30 if (ia[2*i] != 25
31 || ia[2*i + 1] != 5)
32 abort ();
33 }
34
35 for (i = 1; i <= n/2; i++)
36 {
37 sa[2*i] = 25;
38 sa[2*i + 1] = 5;
39 }
40
41 /* check results: */
42 #pragma GCC novector
43 for (i = 1; i <= n/2; i++)
44 {
45 if (sa[2*i] != 25
46 || sa[2*i + 1] != 5)
47 abort ();
48 }
49
50
51 return 0;
52 }
53
54 int main (void)
55 {
56
57 check_vect ();
58
59 return main1 (N);
60 }
61
62 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
63 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
64 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { { ! vect_unaligned_possible } || { ! vect_natural_alignment } } } } } */