view gcc/testsuite/gcc.dg/tree-ssa/loop-17.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 "-O -fdump-tree-sccp-details" } */

/* To determine the number of iterations in this loop we need to fold
   p_4 + 4B > p_4 + 8B to false.  This transformation has caused
   troubles in the past due to overflow issues.  */

int foo (int *p)
{
  int i = 0, *x;

  for (x = p; x < p + 2; x++)
    i++;

  return i;
}

/* { dg-final { scan-tree-dump "# of iterations 1, bounded by 1" "sccp" } } */