(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tree-ssa/
slsr-37.c
       1  /* Verify straight-line strength reduction for a candidate with a basis
       2     hidden by a phi dependence and having an unknown stride.  Variation
       3     using negative increments.  */
       4  
       5  /* { dg-do compile } */
       6  /* { dg-options "-O3 -fdump-tree-optimized" } */
       7  
       8  int
       9  f (int s, int c, int i)
      10  {
      11    int a1, a2, a3, x1, x2, x3, x;
      12  
      13    a1 = i * s;
      14    x1 = c + a1;
      15  
      16    i = i - 2;
      17    a2 = i * s;
      18    x2 = c + a2;
      19  
      20    if (x2 > 6)
      21      i = i - 2;
      22  
      23    i = i - 2;
      24    a3 = i * s;
      25    x3 = c + a3;
      26  
      27    x = x1 + x2 + x3;
      28    return x;
      29  }
      30  
      31  /* { dg-final { scan-tree-dump-times " \\* s" 1 "optimized" } } */
      32  /* { dg-final { scan-tree-dump-times " \\* 2" 1 "optimized" } } */