gcc/testsuite/gcc.dg/tree-ssa/ivopt_mult_3.c
raw| 1 | /* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */ |
| 2 | /* { dg-options "-O2 -m64 -fdump-tree-ivopts-details" } */ |
| 3 | |
| 4 | /* iv p2 can be eliminated. */ |
| 5 | long foo(long* p, long* p2, int N1, int N2) |
| 6 | { |
| 7 | unsigned long i = 0; |
| 8 | long* p_limit2 = p2 + N2; |
| 9 | long s = 0; |
| 10 | while (i < N1) |
| 11 | { |
| 12 | p2++; |
| 13 | i++; |
| 14 | if (p2 > p_limit2) |
| 15 | break; |
| 16 | s += p[i]; |
| 17 | } |
| 18 | return s; |
| 19 | } |
| 20 | |
| 21 | /* { dg-final { scan-tree-dump-times "Replacing exit test: if \\(.*p2.*\\)" 1 "ivopts"} } */ |