(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-gather-4.c
       1  /* { dg-do compile } */
       2  
       3  #define N 16
       4  
       5  void
       6  f1 (int *restrict y, int *restrict x1, int *restrict x2,
       7      int *restrict indices)
       8  {
       9    for (int i = 0; i < N; ++i)
      10      {
      11        y[i * 2] = (indices[i * 2] < N * 2
      12  		  ? x1[indices[i * 2]] + 1
      13  		  : 1);
      14        y[i * 2 + 1] = (indices[i * 2 + 1] < N * 2
      15  		      ? x2[indices[i * 2 + 1]] + 2
      16  		      : 2);
      17      }
      18  }
      19  
      20  void
      21  f2 (int *restrict y, int *restrict x, int *restrict indices)
      22  {
      23    for (int i = 0; i < N; ++i)
      24      {
      25        y[i * 2] = (indices[i * 2] < N * 2
      26  		  ? x[indices[i * 2]] + 1
      27  		  : 1);
      28        y[i * 2 + 1] = (indices[i * 2 + 1] < N * 2
      29  		      ? x[indices[i * 2 + 1] * 2] + 2
      30  		      : 2);
      31      }
      32  }
      33  
      34  void
      35  f3 (int *restrict y, int *restrict x, int *restrict indices)
      36  {
      37    for (int i = 0; i < N; ++i)
      38      {
      39        y[i * 2] = (indices[i * 2] < N * 2
      40  		  ? x[indices[i * 2]] + 1
      41  		  : 1);
      42        y[i * 2 + 1] = (indices[i * 2 + 1] < N * 2
      43  		      ? x[(unsigned int) indices[i * 2 + 1]] + 2
      44  		      : 2);
      45      }
      46  }
      47  
      48  /* { dg-final { scan-tree-dump-not "Loop contains only SLP stmts" vect { target vect_gather_load_ifn } } } */