1 /* { dg-do compile } */ 2 /* { dg-options "-O2 -funroll-loops -fdump-tree-cunroll-details" } */ 3 4 __attribute__ ((pure)) 5 int bla(int); 6 foo(void)7int foo(void) 8 { 9 int i; 10 int sum = 0; 11 12 /* This loop used to appear to be too large for unrolling. */ 13 for (i = 0; i < 4; i++) 14 { 15 sum += bla (i); 16 sum += bla (2*i); 17 sum += bla (3*i); 18 sum += bla (4*i); 19 sum += bla (5*i); 20 sum += bla (6*i); 21 sum += bla (7*i); 22 sum += bla (8*i); 23 } 24 return sum; 25 } 26 27 /* { dg-final { scan-tree-dump-times "loop with 3 iterations completely unrolled" 1 "cunroll" } } */ 28