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: unassig...@gcc.gnu.org

        ReportedBy: xinlian...@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]);

}

Reply via email to