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/] [g++.dg/] [opt/] [alias4.C] - Rev 313

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

// PR c++/27768
// Alias grouping was losing some may_aliases, causing us to think
// the store to w.p was dead.

// { dg-do run }
// { dg-options "-O2" }

int N = 1;

struct VA
{
  int *p, *q, *r;

  VA() : p(), q() {}
  VA(const VA&) : p(), q() {}
  ~VA() { if (p) --N; }
};

inline void foo(VA, VA, VA) {}

struct VB
{
  VA va;

  VB() {}

  VB(const VB&)
  {
    va.p = new int(va.q - va.p);
    va.r = va.p + (va.q - va.p);
    foo(va, va, va);
  }
};

struct VC : VB { char c; };
struct V : VC {};

struct WA
{
  struct X {};
  X **p, **q, **r;

  WA() : p() {}
  ~WA() { if (p) --N; }
};

struct W : WA {};

int main()
{
  {
    V v, u(v);
    W w;
  }
  return N;
}

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

powered by: WebSVN 2.1.0

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