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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [alias4.C] - Blame information for rev 841

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

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/27768
2
// Alias grouping was losing some may_aliases, causing us to think
3
// the store to w.p was dead.
4
 
5
// { dg-do run }
6
// { dg-options "-O2" }
7
 
8
int N = 1;
9
 
10
struct VA
11
{
12
  int *p, *q, *r;
13
 
14
  VA() : p(), q() {}
15
  VA(const VA&) : p(), q() {}
16
  ~VA() { if (p) --N; }
17
};
18
 
19
inline void foo(VA, VA, VA) {}
20
 
21
struct VB
22
{
23
  VA va;
24
 
25
  VB() {}
26
 
27
  VB(const VB&)
28
  {
29
    va.p = new int(va.q - va.p);
30
    va.r = va.p + (va.q - va.p);
31
    foo(va, va, va);
32
  }
33
};
34
 
35
struct VC : VB { char c; };
36
struct V : VC {};
37
 
38
struct WA
39
{
40
  struct X {};
41
  X **p, **q, **r;
42
 
43
  WA() : p() {}
44
  ~WA() { if (p) --N; }
45
};
46
 
47
struct W : WA {};
48
 
49
int main()
50
{
51
  {
52
    V v, u(v);
53
    W w;
54
  }
55
  return N;
56
}

powered by: WebSVN 2.1.0

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