Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-76.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 #define N 24
8 #define OFF 4
9
10 /* Check handling of accesses for which the "initial condition" -
11 the expression that represents the first location accessed - is
12 more involved than just an ssa_name. */
13
14 int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
15 int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
16
17 __attribute__ ((noinline))
18 int main1 (int *pib)
19 {
20 int i;
21 int ia[N+OFF];
22
23 for (i = OFF; i < N; i++)
24 {
25 ia[i] = pib[i - OFF];
26 }
27
28
29 /* check results: */
30 #pragma GCC novector
31 for (i = OFF; i < N; i++)
32 {
33 if (ia[i] != pib[i - OFF])
34 abort ();
35 }
36
37 for (i = 0; i < N; i++)
38 {
39 ia[i] = pib[i - OFF];
40 }
41
42
43 /* check results: */
44 #pragma GCC novector
45 for (i = 0; i < N; i++)
46 {
47 if (ia[i] != pib[i - OFF])
48 abort ();
49 }
50
51 for (i = OFF; i < N; i++)
52 {
53 ia[i] = ic[i - OFF];
54 }
55
56
57 /* check results: */
58 #pragma GCC novector
59 for (i = OFF; i < N; i++)
60 {
61 if (ia[i] != ic[i - OFF])
62 abort ();
63 }
64
65 return 0;
66 }
67
68 int main (void)
69 {
70 check_vect ();
71
72 main1 (&ib[OFF]);
73 return 0;
74 }
75
76
77 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
78 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */