view gcc/testsuite/gcc.dg/tree-ssa/loop-23.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2 -funroll-loops -fdump-tree-cunroll-details" } */

__attribute__ ((pure))
int bla(int);

int foo(void)
{
  int i;
  int sum = 0;

  /* This loop used to appear to be too large for unrolling.  */
  for (i = 0; i < 4; i++)
    {
      sum += bla (i);
      sum += bla (2*i);
      sum += bla (3*i);
      sum += bla (4*i);
      sum += bla (5*i);
      sum += bla (6*i);
      sum += bla (7*i);
      sum += bla (8*i);
    }
  return sum;
}

/* { dg-final { scan-tree-dump-times "loop with 3 iterations completely unrolled" 1 "cunroll" } } */