1 /* A test for strength reduction and induction variable elimination.
2 Target is restricted to x86 type architectures, so that we may
3 assume something about memory addressing modes. */
5 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
6 /* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-fpic" "-fPIC" } { "" } } */
7 /* { dg-options "-O1 -fno-pic -fno-PIC -fdump-tree-optimized" } */
17 for (iter
= 0; iter
< 100; iter
++)
18 arr_base
[iter
] = foo (iter
);
21 /* Access to arr_base[iter].y should not be strength reduced, since
22 we have a memory mode including multiplication by 4. */
24 /* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
25 /* { dg-final { scan-tree-dump-times "step:" 1 "optimized" } } */
27 /* And original induction variable should be preserved. */
29 /* { dg-final { scan-tree-dump-times "int iter" 1 "optimized" } } */
31 /* { dg-final { cleanup-tree-dump "optimized" } } */