view gcc/testsuite/c-c++-common/unroll-4.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2 -funroll-all-loops -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" } */

extern void bar (int);

int j;

void test (void)
{
  #pragma GCC unroll 0
  #pragma GCC ivdep
  for (unsigned long i = 1; i <= 3; ++i)
    bar(i);

  #pragma GCC ivdep
  #pragma GCC unroll 0
  for (unsigned long i = 1; i <= j; ++i)
    bar(i);

  /* { dg-final { scan-tree-dump "Not unrolling loop .: user didn't want it unrolled completely" "cunrolli" } } */
  /* { dg-final { scan-rtl-dump-times "Not unrolling loop, user didn't want it unrolled" 2 "loop2_unroll" } } */
}