(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-live-5.c
       1  /* { dg-require-effective-target vect_int } */
       2  /* { dg-additional-options "-fno-tree-scev-cprop" } */
       3  
       4  #include "tree-vect.h"
       5  
       6  /* Statement that is simple and invariant used outside the loop.
       7     NOTE: SCEV disabled to ensure the live operation is not removed before
       8     vectorization.  */
       9  __attribute__ ((noinline)) int
      10  liveloop (int start, int n, int *x, int *y)
      11  {
      12    int i = start;
      13    int j;
      14    int ret;
      15  
      16    for (j = 0; j < n; ++j)
      17      {
      18        i += 1;
      19        ret = y[0];
      20        x[j] = i + ret;
      21      }
      22    return ret;
      23  }
      24  
      25  #define MAX 77
      26  #define START 37
      27  
      28  int
      29  main (void)
      30  {
      31    int a[MAX];
      32    int b = 99;
      33    int i;
      34  
      35    check_vect ();
      36  
      37    int ret = liveloop (START, MAX, a, &b);
      38  
      39    if (ret != 99)
      40      abort ();
      41  
      42    for (i=0; i<MAX; i++)
      43      {
      44        __asm__ volatile ("");
      45        if (a[i] != i+START+100)
      46  	abort ();
      47      }
      48  }
      49  
      50  /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
      51  /* { dg-final { scan-tree-dump-not "vec_stmt_relevant_p: stmt live but not relevant" "vect" } } */