1 /* { dg-do compile } */
6 f1 (int *restrict y
, int *restrict x1
, int *restrict x2
,
9 for (int i
= 0; i
< N
; ++i
)
12 y
[i
* 2] = x1
[indices
[i
* 2]] + 1;
13 y
[i
* 2 + 1] = x2
[indices
[i
* 2 + 1]] + 2;
18 f2 (int *restrict y
, int *restrict x
, int *restrict indices
)
20 for (int i
= 0; i
< N
; ++i
)
22 /* Different scale. */
23 y
[i
* 2] = *(int *)((char *)x
+ (__UINTPTR_TYPE__
)indices
[i
* 2] * 4) + 1;
24 y
[i
* 2 + 1] = *(int *)((char *)x
+ (__UINTPTR_TYPE__
)indices
[i
* 2 + 1] * 2) + 2;
29 f3 (int *restrict y
, int *restrict x
, int *restrict indices
)
31 for (int i
= 0; i
< N
; ++i
)
34 y
[i
* 2] = x
[indices
[i
* 2]] + 1;
35 y
[i
* 2 + 1] = x
[((unsigned int *) indices
)[i
* 2 + 1]] + 2;
39 /* { dg-final { scan-tree-dump "different gather base" vect { target { ! vect_gather_load_ifn } } } } */
40 /* { dg-final { scan-tree-dump "different gather scale" vect { target { ! vect_gather_load_ifn } } } } */