| 1 |
/* This tests strength reduction and choice of induction variables. The targets |
| 2 |
for this testcase are quite limited, as with different set of available |
| 3 |
addressing modes, the results may be quite different. |
| 4 |
|
| 5 |
The testcase comes from PR 29256 (and originally, the stream benchmark). */ |
| 6 |
|
| 7 |
/* { dg-do compile { target { i?86-*-* || { x86_64-*-* || { powerpc_hard_double && { ! powerpc_fprs } } } } } } */ |
| 8 |
/* { dg-require-effective-target nonpic } */ |
| 9 |
/* { dg-options "-O3 -fno-tree-loop-distribute-patterns -fno-prefetch-loop-arrays -fdump-tree-optimized -fno-common" } */ |
| 10 |
|
| 11 |
# define N 2000000 |
| 12 |
double a[N],c[N]; |
| 13 |
void tuned_STREAM_Copy() |
| 14 |
{ |
| 15 |
int j; |
| 16 |
for (j=0; j<N; j++) |
| 17 |
c[j] = a[j]; |
| 18 |
} |
| 19 |
|
| 20 |
/* Check that the memory references are based on &a and &c, with appropriate |
| 21 |
offsets. Ideally, we would want each of them to appear once in the output. |
| 22 |
However, due to a bug in jump threading, we end up peeling one iteration from |
| 23 |
the loop, which creates an additional occurrence. */ |
| 24 |
|
| 25 |
/* { dg-final { scan-tree-dump-times "MEM\[^;\]*&a" 1 "optimized" } } */ |
| 26 |
/* { dg-final { scan-tree-dump-times "MEM\[^;\]*&c" 1 "optimized" } } */ |
| 27 |
|