(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-alias-check-4.c
       1  /* { dg-do compile } */
       2  /* { dg-require-effective-target vect_int } */
       3  /* { dg-additional-options "--param vect-max-version-for-alias-checks=0 -fopt-info-vec-all" } */
       4  
       5  #define N 16
       6  
       7  struct s1 { int a[N]; };
       8  struct s2 { struct s1 b; int c; };
       9  struct s3 { int d; struct s1 e; };
      10  union u { struct s2 f; struct s3 g; };
      11  
      12  /* We allow a and b to overlap arbitrarily.  */
      13  
      14  void
      15  f1 (int a[][N], int b[][N]) /* { dg-message "vectorized 0 loops in function" } */
      16  {
      17    for (int i = 0; i < N; ++i) /* { dg-missed "couldn't vectorize loop" } */
      18      a[0][i] += b[0][i];
      19    /* { dg-message "will not create alias checks, as --param vect-max-version-for-alias-checks == 0" "" { target *-*-* } .-2 } */
      20  }
      21  
      22  void
      23  f2 (union u *a, union u *b) /* { dg-message "vectorized 0 loops in function" } */
      24  {
      25    for (int i = 0; i < N; ++i) /* { dg-missed "couldn't vectorize loop" } */
      26      a->f.b.a[i] += b->g.e.a[i];
      27    /* { dg-message "will not create alias checks, as --param vect-max-version-for-alias-checks == 0" "" { target *-*-* } .-2 } */
      28  }
      29  
      30  void
      31  f3 (struct s1 *a, struct s1 *b) /* { dg-message "vectorized 0 loops in function" } */
      32  {
      33    for (int i = 0; i < N - 1; ++i) /* { dg-missed "couldn't vectorize loop" } */
      34      a->a[i + 1] += b->a[i]; /* { dg-missed "possible dependence between data-refs" } */
      35  }
      36  
      37  /* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" } } */