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 c++/55245] New: Compiler segfault when compiling the small test case


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

             Bug #: 55245
           Summary: Compiler segfault when compiling the small test case
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xinliangli@gmail.com


Compiling the following program without any option, gcc segfaults:

get.cc: In member function 'virtual void Test2::TestBody()':
get.cc:22:27: internal compiler error: Segmentation fault


The problem is that one array type Vector2_f[2]'s size field is reset to zero
during gimplify_type_sizes by one of its variant (which has null size).

The problem does not show up in trunk compiler.  Was this fixed explicitly in
trunk or it happens to work by luck?

David



template <typename VType> class Vector2 { };
typedef Vector2<float> Vector2_f;

void GetR( const Vector2_f mosaic_position[3]);

class Test1 {
 private: virtual void TestBody();
};

void Test1::TestBody() {
  Vector2_f mosaic_position[2][1];   // (1)
}

class Test2 {
 private: virtual void TestBody();
};

int tri;
void Test2::TestBody() {
  Vector2_f mosaic_position[2][3] = { };
  GetR(mosaic_position[tri]);
}


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