No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / tree-ssa / loop-8.c
blob9718aad33cf7398745a8a3381d38d115ef579e97
1 /* A test for strength reduction of ivs with nonconstant step. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1 -fdump-tree-vars" } */
6 int bar (void);
8 int a[100];
10 void xxx (void)
12 int iter, step = bar ();
14 for (iter = 0; iter < 10; iter++)
15 a[iter * step] = bar ();
18 /* The array access should be strength reduced. But to determine the value of
19 the step, we need to calculate step * sizeof (int), thus we need to be
20 a bit careful about which multiplications we disallow. */
22 /* { dg-final { scan-tree-dump-times "step \\* \[^0-9\]" 0 "vars" } } */
23 /* { dg-final { scan-tree-dump-times "\[^0-9\] \\* step" 0 "vars" } } */
25 /* { dg-final { cleanup-tree-dump "vars" } } */