1 /* Verify straight-line strength reduction for multiply candidates 2 with variable stride and control flow, increment = -1. */ 3 4 /* { dg-do compile } */ 5 /* { dg-options "-O3 -fdump-tree-optimized" } */ 6 7 int f(int n,int x,int stride)8f (int n, int x, int stride) 9 { 10 int a, x1, x2, x3; 11 12 a = x * stride; 13 14 if (n > 64) 15 { 16 x1 = x - 1; 17 a += x1 * stride; 18 x2 = x1 - 1; 19 a += x2 * stride; 20 } 21 else 22 { 23 x3 = x - 1; 24 a += x3 * stride; 25 } 26 27 return a; 28 } 29 30 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */ 31