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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [gcc.dg/] [pr19633.c] - Blame information for rev 516

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do link } */
2
/* { dg-options "-O2" } */
3
 
4
struct S
5
{
6
  int w, x, y, z;
7
};
8
 
9
struct T
10
{
11
  int r;
12
  struct S s;
13
};
14
 
15
void
16
foo (int a, struct T b)
17
{
18
  struct S *c = 0;
19
 
20
  if (a)
21
    c = &b.s;
22
 
23
  b.s.w = 3;
24
 
25
  /* Since 'c' may be pointing to NULL here, we used to flag it as
26
     pointing anywhere, which was forcing the aliaser to mark as
27
     call-clobbered every other variable pointed-to by 'c' ('b' in
28
     this case).  This, in turn, caused the insertion of V_MAY_DEFs
29
     for 'b' at this call-site, which prevented constant propagation
30
     from 'b.s.w = 3' to 'if (b.s.w != 3)'.  */
31
  bar (*c, a);
32
 
33
  if (b.s.w != 3)
34
    link_error ();
35
}
36
 
37
int main ()
38
{
39
  struct T b;
40
  foo (3, b);
41
  return 0;
42
}
43
 
44
int X;
45
 
46
int bar (struct S x, int i)
47
{
48
  X = 3;
49
}

powered by: WebSVN 2.1.0

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