aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-17.c
blob: 0e856d8d54f4aeef8bc6287b0262cea480957f0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { 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" } } */
/* { dg-final { cleanup-tree-dump "sccp" } } */