This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55245] New: Compiler segfault when compiling the small test case
- From: "xinliangli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 09 Nov 2012 00:22:18 +0000
- Subject: [Bug c++/55245] New: Compiler segfault when compiling the small test case
- Auto-submitted: auto-generated
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]);
}