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/] [ssa-pre-19.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
3
 
4
struct Loc {
5
    int x[3];
6
};
7
 
8
void bar (struct Loc *);
9
 
10
int foo (int i, int j, int k, int b)
11
{
12
  struct Loc IND;
13
  int res;
14
 
15
  if (b)
16
    {
17
      IND.x[0] = i;
18
      IND.x[1] = j;
19
      IND.x[2] = k-1;
20
    }
21
  else
22
    {
23
      IND.x[0] = i;
24
      IND.x[1] = j;
25
      IND.x[2] = k;
26
    }
27
 
28
  /* This should be optimized to i + j + {k, k + 1}.  */
29
  res = IND.x[0] + IND.x[1] + IND.x[2];
30
 
31
  /* This is just to prevent SRA.  */
32
  bar (&IND);
33
 
34
  return res;
35
}
36
 
37
/* All three loads should be eliminated.  */
38
/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
39
/* { dg-final { cleanup-tree-dump "pre" } } */

powered by: WebSVN 2.1.0

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