aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr114322.c
blob: 2642abf37188d44e2e8e897b79d1e4c08f867bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR tree-optimization/114322 */
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */

int
foo (int *A, int *B, int x, int stride)
{
  int sum = 0;

  if (stride > 1)
    {
      for (int i = 0; i < 1024; ++i)
        sum += A[(i + x) * stride] + B[i];
    }

  return sum;
}

/* { dg-final { scan-tree-dump-not "failed: evolution of base is not affine." "vect" } } */
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */