summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-alias-check-6.c
blob: 0993c69a5bd306c83b665f18a39606dbec3d897e (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 } */

#define N 16

struct s { int x[N]; };

void
f1 (struct s *a, struct s *b)
{
  for (int i = 0; i < N - 1; ++i)
    a->x[i + 1] += b->x[i];
}

void
f2 (struct s *a, struct s *b)
{
  for (int i = 0; i < N; ++i)
    a->x[i] += b->x[N - i - 1];
}

/* { dg-final { scan-tree-dump-times {checking that [^\n]* and [^\n]* have different addresses} 2 "vect" } } */
/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 2 "vect" } } */