(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-29.c
       1  /* Disabling epilogues until we find a better way to deal with scans.  */
       2  /* { dg-additional-options "--param vect-epilogues-nomask=0" } */
       3  /* { dg-require-effective-target vect_int } */
       4  /* { dg-add-options bind_pic_locally } */
       5  
       6  #include <stdarg.h>
       7  #include "tree-vect.h"
       8  
       9  #define N 128
      10  #define OFF 3
      11  
      12  /* unaligned load.  */
      13  
      14  int ia[N];
      15  int ib[N+OFF];
      16  
      17  __attribute__ ((noinline))
      18  int main1 (int off)
      19  {
      20    int i;
      21  
      22    for (i = 0; i < N+OFF; i++)
      23      {
      24        ib[i] = i;
      25      }
      26  
      27    for (i = 0; i < N; i++)
      28      {
      29        ia[i] = ib[i+off];
      30      }
      31  
      32    /* check results:  */
      33    for (i = 0; i < N; i++)
      34      {
      35        if (ia[i] != ib[i+off])
      36          abort ();
      37      }
      38  
      39    return 0;
      40  }
      41  
      42  int main (void)
      43  { 
      44    check_vect ();
      45    
      46    main1 (0); /* aligned */
      47    main1 (OFF); /* unaligned */
      48    return 0;
      49  }
      50  
      51  /* For targets that don't support misaligned loads we version for the load.
      52     (The store is aligned).  */
      53  
      54  /* The initialization induction loop (with aligned access) is also vectorized.  */
      55  /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
      56  /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! vect_unaligned_possible } } } } */
      57  /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
      58  /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" {target { vect_no_align && { ! vect_hw_misalign } } } } } */