aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-alias-check-13.c
blob: 812aa9027dd8cc9c8a566c9f74f6008e48fa7dc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */

void
f1 (int *x, long step1, int n)
{
  for (int i = 0; i < n; ++i)
    x[i * step1] += 1;
}

void
f2 (int *x, long step2, int n)
{
#pragma GCC ivdep
  for (int i = 0; i < n; ++i)
    x[i * step2] += 2;
}

/* { dg-final { scan-tree-dump {need run-time check that [^\n]*step1[^\n]* is nonzero} "vect" } } */
/* { dg-final { scan-tree-dump-not {need run-time check that [^\n]*step2[^\n]* is nonzero} "vect" } } */
/* { dg-final { scan-tree-dump-not "using an address-based" "vect" } } */
/* { dg-final { scan-tree-dump-not "using an index-based" "vect" } } */
/* { dg-final { scan-tree-dump-times {LOOP VECTORIZED} 2 "vect" } } */