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. */
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;
17 f2 (unsigned short *x
, int stepx
, int n
)
19 for (int i
= 0; i
< n
; i
+= stepx
* 4)
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;
37 f4 (unsigned short *x
, int stepx
, int n
)
39 for (int i
= 0; i
< n
; i
+= stepx
* 4)
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;
57 f6 (unsigned short *x
, int stepx
, int n
)
59 for (int i
= 0; i
< n
; i
+= stepx
* 64)
67 f7 (unsigned short *x
, int stepx
, int n
)
69 for (unsigned short *y
= x
; y
< x
+ n
; y
+= stepx
* 4)
76 unsigned short x
[1000];
81 for (int i
= 0; i
< n
; ++i
)
83 x
[i
* stepx
* 4] = 100;
84 x
[i
* stepx
* 4 + 1] = 99;
91 for (int i
= 0; i
< n
; i
+= stepx
* 4)
101 for (int i
= 0; i
< n
; ++i
)
103 x
[i
* stepx
* 4 - 16] = 100;
104 x
[i
* stepx
* 4 - 15] = 99;
109 g4 (int stepx
, int n
)
111 for (int i
= 0; i
< n
; i
+= stepx
* 4)
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;
129 g6 (int stepx
, int n
)
131 for (int i
= 0; i
< n
; i
+= stepx
* 64)
139 g7 (int stepx
, int n
)
141 for (unsigned short *y
= x
; y
< x
+ n
; y
+= stepx
* 4)
148 /* { dg-final { scan-tree-dump-not {want to version} "lversion" } } */
149 /* { dg-final { scan-tree-dump-not {versioned} "lversion" } } */