OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [loop-7.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* PR tree-optimization/19828 */
2
/* { dg-do compile } */
3
/* { dg-options "-O1 -fdump-tree-lim-details" } */
4
 
5
int cst_fun1 (int) __attribute__((__const__));
6
int cst_fun2 (int) __attribute__((__const__));
7
int pure_fun1 (int) __attribute__((__pure__));
8
int pure_fun2 (int) __attribute__((__pure__));
9
int foo (void);
10
 
11
int xxx (void)
12
{
13
  int i, k = foo (), x = 0;
14
 
15
  for (i = 0; i < 100; i++)
16
    {
17
      x += cst_fun1 (k);
18
      x += pure_fun1 (k);
19
 
20
      if (k)
21
        {
22
          x += cst_fun2 (k);
23
          x += pure_fun2 (k);
24
        }
25
    }
26
 
27
  return x;
28
}
29
 
30
/* Calls to cst_fun1 and pure_fun1 may be moved out of the loop.
31
   Calls to cst_fun2 and pure_fun2 should not be, since calling
32
   with k = 0 may be invalid.  */
33
 
34
/* { dg-final { scan-tree-dump-times "Moving statement" 3 "lim" } } */
35
/* { dg-final { cleanup-tree-dump "lim" } } */

powered by: WebSVN 2.1.0

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