> cat bug.ii

void* operator new(unsigned long, void* __p) { }

struct auto_ptr {
        int* p;
        ~auto_ptr() { delete p; }
};

typedef void* T;
struct vector {
        void push_back(const T& __x) {
                ::new(0) T(__x);
                insert(__x);
        }
        void insert(const T& __x);
} v;

void g();
void f() {
        auto_ptr ap;
        if (ap.p) {
                ap.p = new int();
        }
        g();
        int* tmp = ap.p;
        ap.p = 0;
        v.push_back(tmp);
}

> g++ -O bug.ii
Unable to coalesce ssa_names 13 and 16 which are marked as MUST COALESCE.
ap$p_13(ab) and  ap$p_16(ab)
bug.ii: In function ‘void f()’:
bug.ii:18: internal compiler error: SSA corruption


Tested with SVN revision 128251 on linux_x86_64.


-- 
           Summary: ICE: SSA corruption   with -O
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wouter dot vermaelen at scarlet dot be


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

Reply via email to