view gcc/testsuite/gcc.dg/tree-ssa/pr68529-3.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile { target size32plus } } */
/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */

void bar(char *s);
int foo1(unsigned short l)
{
  char c[10000] = {};
  unsigned short nchar = 9999;

  while(nchar-- != l)
    {
      c[nchar] = 'A';
    }

  bar (c);
  return 0;
}

int foo2()
{
  char c[100000] = {};
  unsigned short nchar;

  for (nchar = 0; nchar != 1000; --nchar)
    {
      c[nchar] = 'A';
    }

  bar (c);
  return 0;
}

int foo3()
{
  char c[100000] = {};
  unsigned short nchar;

  for (nchar = 0; nchar != 1000; nchar += 3)
    {
      c[nchar] = 'A';
    }

  bar (c);
  return 0;
}

/* { dg-final { scan-tree-dump-times "failed: evolution of offset is not affine" 3 "ldist" } } */