(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
no-section-anchors-vect-31.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  /* N / 2 bytes has to be worth vectorizing even with peeling.  */
      10  #if VECTOR_BITS > 128
      11  #define N (VECTOR_BITS * 4 / 8)
      12  #else
      13  #define N 64
      14  #endif
      15  
      16  struct t{
      17    int k[N];
      18    int l; 
      19  };
      20    
      21  struct s{
      22    char a;	/* aligned */
      23    char b[N-1];  /* unaligned (offset 1B) */
      24    char c[N];    /* aligned (offset NB) */
      25    struct t d;   /* aligned (offset 2NB) */
      26    struct t e;   /* unaligned (offset 2N+4N+4 B) */
      27  };
      28   
      29  struct s tmp;
      30  __attribute__ ((noinline))
      31  int main1 ()
      32  {  
      33    int i;
      34  
      35    /* unaligned */
      36    for (i = 0; i < N/2; i++)
      37      {
      38        tmp.b[i] = 5;
      39      }
      40  
      41    /* check results:  */
      42    for (i = 0; i <N/2; i++)
      43      {
      44        if (tmp.b[i] != 5)
      45          abort ();
      46      }
      47  
      48    /* aligned */
      49    for (i = 0; i < N/2; i++)
      50      {
      51        tmp.c[i] = 6;
      52      }
      53  
      54    /* check results:  */
      55    for (i = 0; i <N/2; i++)
      56      {
      57        if (tmp.c[i] != 6)
      58          abort ();
      59      }
      60  
      61    /* aligned */
      62    for (i = 0; i < N/2; i++)
      63      {
      64        tmp.d.k[i] = 7;
      65      }
      66  
      67    /* check results:  */
      68    for (i = 0; i <N/2; i++)
      69      {
      70        if (tmp.d.k[i] != 7)
      71          abort ();
      72      }
      73  
      74    /* unaligned */
      75    for (i = 0; i < N/2; i++)
      76      {
      77        tmp.e.k[i] = 8;
      78      }
      79  
      80    /* check results:  */
      81    for (i = 0; i <N/2; i++)
      82      {
      83        if (tmp.e.k[i] != 8)
      84          abort ();
      85      }
      86  
      87    return 0;
      88  }
      89  
      90  int main (void)
      91  { 
      92    check_vect ();
      93    
      94    return main1 ();
      95  } 
      96  
      97  /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
      98  /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
      99  /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_element_align_preferred } } } */