1 /* { dg-do compile } */
3 /* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
15 for (i
= 2; i
< 1000; i
++)
16 fib
[i
] = (fib
[i
-1] + fib
[i
- 2]) & 0xffff;
21 void count_averages(int n
)
25 for (i
= 1; i
< n
; i
++)
26 avg
[i
] = (((unsigned long) fib
[i
- 1] + fib
[i
] + fib
[i
+ 1]) / 3) & 0xffff;
34 if (fib
[19] != 4181 || avg
[19] != 4510)
37 if (fib
[999] != 162 || avg
[998] != 21953)
43 /* Verify that both loops were transformed and unrolled. */
44 /* { dg-final { scan-tree-dump-times "Unrolling 2 times." 2 "pcom"} } */
46 /* Also check that we undid the transformation previously made by PRE. */
47 /* { dg-final { scan-tree-dump-times "looparound ref" 1 "pcom"} } */
49 /* { dg-final { cleanup-tree-dump "pcom" } } */