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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [ipa-sra-2.c] - Blame information for rev 701

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

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