This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/17400] [4.0 Regression] out of SSA corruption


------- Additional Comments From belyshev at lubercy dot com  2004-09-10 18:19 -------
// small testcase, use '-O1':

void inc (int &);
bool dec_test (int &);

struct A
{
  int c;
  
  friend void AddRef (A * p)
  {
    inc (p->c);
  }
  
  friend void Release (A * p)
  {
    if(dec_test (p->c))
      delete p;
  }
};

struct B
{
  B (A *p) : obj(p)
  {
    AddRef (obj);
  }
  
  ~B()
  {
    Release (obj);
  }
  
  void swap (B &rhs)
  {
    A * tmp = obj;
    obj = rhs.obj;
    rhs.obj = tmp;
  }
  
  A *obj;
};

void bar (A *p1, A* p2)
{
    B px (p1);
    B px2 (p2);
    px.swap (px2);
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-10 18:19:19
               date|                            |
            Summary|out of SSA corruption       |[4.0 Regression] out of SSA
                   |                            |corruption
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17400


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]