The following C++ code crashes the mainline compiler on
x86_64-unknown-linux-gnu when compiled with -O3:

===================================
struct A
{
    double x[4];
};

struct B
{
    A y[2];
};

A foo(B *p)
{
    for ( int i=0; i<4; ++i )
        p->y[1].x[i]=0;

    A a;
    return a;
}
===================================

bug.cc: In function 'A foo(B*)':
bug.cc:11: internal compiler error: in add_virtual_operand, at
tree-ssa-operands.c:1867
Please submit a full bug report,

In fact "-O2" is enough to trigger the bug in 64bit mode, but
in conjunction with "-m32" I need "-O3".

The bug is probably related to PR 26338, but I can't test Ada
and trigger the bug mentioned in the first comment.


-- 
           Summary: [4.2 regression] ICE in add_virtual_operand, at tree-
                    ssa-operands.c:1867
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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

Reply via email to