(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-80-big-array.c
       1  /* { dg-require-effective-target vect_float } */
       2  
       3  #include <stdarg.h>
       4  #include "tree-vect.h"
       5  
       6  #define N 128
       7  
       8  float fa[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
       9  float fb[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
      10  float fc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
      11  
      12  /* Check handling of accesses for which the "initial condition" -
      13     the expression that represents the first location accessed - is
      14     more involved than just an ssa_name.  */
      15  
      16  __attribute__ ((noinline)) int
      17  main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
      18  {
      19    int i;
      20    float *q = pb + 4;
      21    for (i = 0; i < N; i++)
      22      {
      23        fb[i] = i;
      24        fc[i] = 0.5+i;
      25        asm volatile ("" ::: "memory");
      26      }
      27    for (; i < N+4; i++)
      28      {
      29        fb[i] = i;
      30        asm volatile ("" ::: "memory");
      31      }
      32  
      33    for (i = 0; i < N; i++)
      34      {
      35        pa[i] = q[i] * pc[i];
      36      }
      37  
      38    for (i = 0; i < N; i++)
      39      {
      40        if (pa[i] != q[i] * pc[i])
      41  	abort ();
      42      }
      43  
      44    return 0;
      45  }
      46  
      47  
      48  int main (void)
      49  {
      50    check_vect ();
      51  
      52    main1 (fa, fb, fc);
      53  
      54    return 0;
      55  }
      56  
      57  /* For targets that don't support misaligned loads we version for the
      58     all three accesses (peeling to align the store will not force the
      59     two loads to be aligned).  */
      60  
      61  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
      62  /* Uncomment when this testcase gets vectorized again:
      63   dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } }
      64   dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } }
      65   dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } }
      66  */