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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [ipa-sra-2.c] - Blame information for rev 327

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details"  } */
3
 
4
struct bovid
5
{
6
  float red;
7
  int green;
8
  void *blue;
9
};
10
 
11
static int
12
__attribute__((noinline))
13
ox (struct bovid *cow)
14
{
15
  cow->red = cow->red + cow->green + cow->green;
16
  return 0;
17
}
18
 
19
int something;
20
 
21
static int
22
__attribute__((noinline))
23
ox_improved (struct bovid *calf)
24
{
25
  if (something > 0)
26
    calf->red = calf->red + calf->green;
27
  else
28
    calf->red = calf->green + 87;
29
  something = 77;
30
  return 0;
31
}
32
 
33
 
34
int main (int argc, char *argv[])
35
{
36
  struct bovid cow;
37
 
38
  cow.red = 7.4;
39
  cow.green = 6;
40
  cow.blue = &cow;
41
 
42
  ox (&cow);
43
 
44
  ox_improved (&cow);
45
  return 0;
46
}
47
 
48
/* { dg-final { scan-tree-dump "About to replace expr cow_.*D.->red with \\*ISRA" "eipa_sra"  } } */
49
/* { dg-final { scan-tree-dump "About to replace expr cow_.*D.->green with ISRA" "eipa_sra"  } } */
50
/* { dg-final { scan-tree-dump "About to replace expr calf_.*D.->red with \\*ISRA" "eipa_sra"  } } */
51
/* { dg-final { scan-tree-dump "About to replace expr calf_.*D.->green with ISRA" "eipa_sra"  } } */
52
/* { dg-final { cleanup-tree-dump "eipa_sra" } } */

powered by: WebSVN 2.1.0

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