builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-versioning-14.c
blobf2926e5650c7cb31e3643be7ad221f578c88b7e3
1 /* { dg-options "-O3 -fdump-tree-lversion-details" } */
3 /* Test that we don't try to version for a step of 1 when that would
4 cause the iterations to leave a gap between accesses. */
6 void
7 f1 (unsigned short *x, int stepx, int n)
9 for (int i = 0; i < n; ++i)
11 x[i * stepx * 4] = 100;
12 x[i * stepx * 4 + 1] = 99;
16 void
17 f2 (unsigned short *x, int stepx, int n)
19 for (int i = 0; i < n; i += stepx * 4)
21 x[i] = 100;
22 x[i + 1] = 99;
26 void
27 f3 (unsigned short *x, int stepx, int n)
29 for (int i = 0; i < n; ++i)
31 x[i * stepx * 4 - 16] = 100;
32 x[i * stepx * 4 - 15] = 99;
36 void
37 f4 (unsigned short *x, int stepx, int n)
39 for (int i = 0; i < n; i += stepx * 4)
41 x[i - 16] = 100;
42 x[i - 15] = 99;
46 void
47 f5 (unsigned short *x, int stepx, int n)
49 for (int i = 0; i < n; ++i)
51 x[i * stepx * 64 - 16] = 100;
52 x[i * stepx * 64 + 15] = 99;
56 void
57 f6 (unsigned short *x, int stepx, int n)
59 for (int i = 0; i < n; i += stepx * 64)
61 x[i - 16] = 100;
62 x[i + 15] = 99;
66 void
67 f7 (unsigned short *x, int stepx, int n)
69 for (unsigned short *y = x; y < x + n; y += stepx * 4)
71 y[0] = 100;
72 y[1] = 99;
76 unsigned short x[1000];
78 void
79 g1 (int stepx, int n)
81 for (int i = 0; i < n; ++i)
83 x[i * stepx * 4] = 100;
84 x[i * stepx * 4 + 1] = 99;
88 void
89 g2 (int stepx, int n)
91 for (int i = 0; i < n; i += stepx * 4)
93 x[i] = 100;
94 x[i + 1] = 99;
98 void
99 g3 (int stepx, int n)
101 for (int i = 0; i < n; ++i)
103 x[i * stepx * 4 - 16] = 100;
104 x[i * stepx * 4 - 15] = 99;
108 void
109 g4 (int stepx, int n)
111 for (int i = 0; i < n; i += stepx * 4)
113 x[i - 16] = 100;
114 x[i - 15] = 99;
118 void
119 g5 (int stepx, int n)
121 for (int i = 0; i < n; ++i)
123 x[i * stepx * 64 - 16] = 100;
124 x[i * stepx * 64 + 15] = 99;
128 void
129 g6 (int stepx, int n)
131 for (int i = 0; i < n; i += stepx * 64)
133 x[i - 16] = 100;
134 x[i + 15] = 99;
138 void
139 g7 (int stepx, int n)
141 for (unsigned short *y = x; y < x + n; y += stepx * 4)
143 y[0] = 100;
144 y[1] = 99;
148 /* { dg-final { scan-tree-dump-not {want to version} "lversion" } } */
149 /* { dg-final { scan-tree-dump-not {versioned} "lversion" } } */