1 /* PR rtl-optimization/64316 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3" } */
4 /* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
5
6 struct S
7 {
8 unsigned int s;
9 unsigned long w[];
10 };
11
12 struct S **s;
13
14 int
foo(struct S * x,struct S * y,struct S * z)15 foo (struct S *x, struct S *y, struct S *z)
16 {
17 unsigned int i;
18 unsigned long *a, *b, *c;
19 int r = 0;
20 for (a = x->w, b = y->w, c = z->w, i = 0; i < x->s; i++, a++)
21 {
22 unsigned long d = *b++ & *c++;
23 if (*a != d)
24 {
25 r = 1;
26 *a = d;
27 }
28 }
29 return r;
30 }
31
32 void
bar(int x)33 bar (int x)
34 {
35 int p = x - 1;
36 do
37 {
38 foo (s[x], s[x], s[p]);
39 p--;
40 }
41 while (p > 0);
42 }
43