1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-rtl-loop2_unroll -fno-peel-loops -fdisable-tree-cunroll -fdisable-tree-cunrolli -fenable-rtl-loop2_unroll=foo2" } */
3
4 unsigned a[100], b[100];
bar()5 inline void bar()
6 {
7 a[10] = b[10];
8 }
9
foo(void)10 int foo(void)
11 {
12 int i;
13 bar();
14 for (i = 0; i < 2; i++)
15 {
16 a[i]= b[i] + 1;
17 }
18 return 1;
19 }
20
foo2(void)21 int foo2(void)
22 {
23 int i;
24 for (i = 0; i < 2; i++)
25 {
26 a[i]= b[i] + 1;
27 }
28 return 1;
29 }
30
31 /* { dg-final { scan-rtl-dump-times "Turned loop into non-loop; it never loops" 1 "loop2_unroll" } } */
32 /* { dg-final { cleanup-rtl-dump "loop2_unroll" } } */
33