public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
@ 2012-08-21 10:24 doko at gcc dot gnu.org
  2012-08-21 11:36 ` [Bug c++/54341] [4.7/4.8 " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: doko at gcc dot gnu.org @ 2012-08-21 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54341
           Summary: [4.7 / 4.8 Regression] ICE (segfault) in
                    cx_check_missing_mem_inits, at cp/semantics.c:6093
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: doko@gcc.gnu.org


[forwarded from http://bugs.debian.org/685430]

works with 4.6, fails with current 4.7 branch and trunk:

#include <memory>


class VTableClass {
public:
    virtual void someVirtualMethod() { }
};

class SomeClass : public std::enable_shared_from_this< SomeClass >, public
VTableClass { };

SomeClass* createInstance()
{
    return new SomeClass;
}


g++ -std=c++0x -c testcase.cc 
testcase.cc: In constructor 'constexpr SomeClass::SomeClass()':
testcase.cc:9:7: internal compiler error: in cx_check_missing_mem_inits, at
cp/semantics.c:6093
 class SomeClass : public std::enable_shared_from_this< SomeClass >, public
VTableClass { };
       ^
Please submit a full bug report,
with preprocessed source if appropriate.


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

* [Bug c++/54341] [4.7/4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
  2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
@ 2012-08-21 11:36 ` paolo.carlini at oracle dot com
  2012-08-21 11:46 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-21 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-08-21
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-21 11:36:23 UTC ---
Seems closely related to PR54253.


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

* [Bug c++/54341] [4.7/4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
  2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
  2012-08-21 11:36 ` [Bug c++/54341] [4.7/4.8 " paolo.carlini at oracle dot com
@ 2012-08-21 11:46 ` paolo.carlini at oracle dot com
  2012-08-21 17:51 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-21 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-21 11:46:12 UTC ---
Reduced:

template<typename T>
struct enable_shared_from_this
{
  constexpr enable_shared_from_this();

private:
  int mem;
};

class VTableClass {
public:
    virtual void someVirtualMethod() { }
};

class SomeClass : public enable_shared_from_this< SomeClass >, public
VTableClass { };

SomeClass* createInstance()
{
    return new SomeClass;
}


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

* [Bug c++/54341] [4.7/4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
  2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
  2012-08-21 11:36 ` [Bug c++/54341] [4.7/4.8 " paolo.carlini at oracle dot com
  2012-08-21 11:46 ` paolo.carlini at oracle dot com
@ 2012-08-21 17:51 ` hjl.tools at gmail dot com
  2012-09-06 16:25 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-21 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com
   Target Milestone|---                         |4.7.2

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-21 17:50:43 UTC ---
It is caused by revision 184001:

http://gcc.gnu.org/ml/gcc-cvs/2012-02/msg00220.html


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

* [Bug c++/54341] [4.7/4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
  2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-08-21 17:51 ` hjl.tools at gmail dot com
@ 2012-09-06 16:25 ` jason at gcc dot gnu.org
  2012-09-07 10:37 ` [Bug c++/54341] [4.7 " rguenth at gcc dot gnu.org
  2012-09-10 14:42 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-06 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-06 16:24:25 UTC ---
Author: jason
Date: Thu Sep  6 16:24:10 2012
New Revision: 191033

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191033
Log:
    PR c++/54341
    PR c++/54253
    * semantics.c (sort_constexpr_mem_initializers): New.
    (build_constexpr_constructor_member_initializers): Use it.
    (cx_check_missing_mem_inits): Skip artificial fields.
    * init.c (expand_aggr_init_1): Don't zero out a class
    with no data.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual2.C
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/init.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/54341] [4.7 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
  2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-09-06 16:25 ` jason at gcc dot gnu.org
@ 2012-09-07 10:37 ` rguenth at gcc dot gnu.org
  2012-09-10 14:42 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-07 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Summary|[4.7/4.8 Regression] ICE    |[4.7 Regression] ICE
                   |(segfault) in               |(segfault) in
                   |cx_check_missing_mem_inits, |cx_check_missing_mem_inits,
                   |at cp/semantics.c:6093      |at cp/semantics.c:6093

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-07 10:36:26 UTC ---
Fixed for trunk sofar.


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

* [Bug c++/54341] [4.7 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093
  2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-09-07 10:37 ` [Bug c++/54341] [4.7 " rguenth at gcc dot gnu.org
@ 2012-09-10 14:42 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-10 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-10 14:24:13 UTC ---
Author: jason
Date: Mon Sep 10 14:24:07 2012
New Revision: 191145

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191145
Log:
    PR c++/54341
    PR c++/54253
    * semantics.c (sort_constexpr_mem_initializers): New.
    (build_constexpr_constructor_member_initializers): Use it.
    (cx_check_missing_mem_inits): Skip artificial fields.
    * init.c (expand_aggr_init_1): Don't zero out a class
    with no data.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual2.C
    branches/gcc-4_7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-virtual3.C
Modified:
    branches/gcc-4_7-branch/gcc/cp/ChangeLog
    branches/gcc-4_7-branch/gcc/cp/init.c
    branches/gcc-4_7-branch/gcc/cp/semantics.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-10 14:42:22 UTC ---
Fixed for 4.7.2 as well.


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

end of thread, other threads:[~2012-09-10 14:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 10:24 [Bug c++/54341] New: [4.7 / 4.8 Regression] ICE (segfault) in cx_check_missing_mem_inits, at cp/semantics.c:6093 doko at gcc dot gnu.org
2012-08-21 11:36 ` [Bug c++/54341] [4.7/4.8 " paolo.carlini at oracle dot com
2012-08-21 11:46 ` paolo.carlini at oracle dot com
2012-08-21 17:51 ` hjl.tools at gmail dot com
2012-09-06 16:25 ` jason at gcc dot gnu.org
2012-09-07 10:37 ` [Bug c++/54341] [4.7 " rguenth at gcc dot gnu.org
2012-09-10 14:42 ` 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).