public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55245] New: Compiler segfault when compiling the small test case
@ 2012-11-09  0:22 xinliangli at gmail dot com
  2012-11-09  0:43 ` [Bug c++/55245] " xinliangli at gmail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: xinliangli at gmail dot com @ 2012-11-09  0:22 UTC (permalink / raw)
  To: gcc-bugs


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]);
}


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-01-02 19:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09  0:22 [Bug c++/55245] New: Compiler segfault when compiling the small test case xinliangli at gmail dot com
2012-11-09  0:43 ` [Bug c++/55245] " xinliangli at gmail dot com
2012-11-09  6:06 ` xinliangli at gmail dot com
2012-11-09  9:06 ` [Bug c++/55245] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
2012-11-21  0:53 ` [Bug c++/55245] [4.6/4.7/4.8 Regression] Compiler segfault when compiling a " dnovillo at gcc dot gnu.org
2012-11-21 16:17 ` xinliangli at gmail dot com
2012-11-26  9:49 ` jakub at gcc dot gnu.org
2012-11-26 18:36 ` dnovillo at gcc dot gnu.org
2012-12-06 16:11 ` rguenth at gcc dot gnu.org
2012-12-06 22:18 ` [Bug c++/55245] [4.6 " jason at gcc dot gnu.org
2012-12-07  4:55 ` jason at gcc dot gnu.org
2012-12-07  5:15 ` jason at gcc dot gnu.org
2013-01-02 19:04 ` jason at gcc dot gnu.org
2013-01-02 19:05 ` jason at gcc dot gnu.org
2013-01-02 19:05 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).