re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / prefetch-3.c
1 /* Prefetching used to prefer nonsensical unroll factor of 5 in this testcase. */
2
3 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
4 /* { dg-require-effective-target ilp32 } */
5 /* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse -fdump-tree-aprefetch-details" } */
6
7 #define N 1000000
8
9 double a[N];
10
11 double test(void)
12 {
13 unsigned i;
14 double sum = 0;
15
16 for (i = 0; i < N; i += 2)
17 sum += (a[i] * a[i+1]);
18
19 return sum;
20 }
21
22 /* { dg-final { scan-tree-dump-times "unroll factor 4" 1 "aprefetch" } } */
23 /* { dg-final { cleanup-tree-dump "aprefetch" } } */