OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [loop-26.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR 30730, PR 26900, number of iterations analysis should be able to
2
   determine number of iterations of the following loops unconditionally.  */
3
 
4
/* { dg-do compile } */
5
/* { dg-options "-O2 -fstrict-overflow -fdump-tree-optimized-blocks" } */
6
 
7
unsigned foo(unsigned int n)
8
{
9
  unsigned x = 0;;
10
 
11
  while (n > 10)
12
    {
13
      n -= 2;
14
      x++;
15
    }
16
 
17
  return x;
18
}
19
 
20
int foo0(int i0, int i1)
21
{
22
  int i, j = 0;
23
  for (i=i0; i<=i1+1; ++i)
24
    ++j;
25
  return j;
26
}
27
 
28
/* { dg-final { scan-tree-dump-times "if" 2 "optimized" } } */
29
/* { dg-final { cleanup-tree-dump "optimized" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.