public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49507] New: ICE because of defaulted template destructor
@ 2011-06-22 21:03 sefi@s-e-f-i.de
  2011-06-23  9:51 ` [Bug c++/49507] [4.6/4.7 Regression] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: sefi@s-e-f-i.de @ 2011-06-22 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE because of defaulted template destructor
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sefi@s-e-f-i.de


The following code makes rc1 of gcc-4.6.1 segfault:

template<typename T>
struct ConcretePoolKey
{
        virtual ~ConcretePoolKey();
};

template<typename T>
ConcretePoolKey<T>::~ConcretePoolKey() = default;

int main()
{
        ConcretePoolKey<int> foo;
}


/usr/bin/g++ -std=c++0x test.cpp
test.cpp: In destructor 'ConcretePoolKey<T>::~ConcretePoolKey() [with T =
int]':
test.cpp:13:1:   instantiated from here
test.cpp:2:8: internal compiler error: Segmentation fault


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
@ 2011-06-23  9:51 ` jakub at gcc dot gnu.org
  2011-06-23 14:29 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-06-23  9:51 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.06.23 09:50:47
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
   Target Milestone|---                         |4.6.1
            Summary|ICE because of defaulted    |[4.6/4.7 Regression] ICE
                   |template destructor         |because of defaulted
                   |                            |template destructor
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-23 09:50:47 UTC ---
Indeed, a regression from 4.6.0, caused by PR47544 fix
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174071
on the trunk and
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174159
on 4.6 branch.

#0  0x00000000006f972a in initialize_vtbl_ptrs (addr=0x0) at
../../gcc/cp/init.c:120
#1  0x000000000051f017 in begin_destructor_body () at ../../gcc/cp/decl.c:13001
#2  0x00000000005201f5 in begin_function_body () at ../../gcc/cp/decl.c:13090
#3  0x0000000000716b58 in synthesize_method (fndecl=0x7ffff1a1be00) at
../../gcc/cp/method.c:741
#4  0x00000000005c8d63 in instantiate_decl (d=0x7ffff1a1be00, defer_ok=0,
expl_inst_class_mem_p=0 '\000') at ../../gcc/cp/pt.c:17738
#5  0x00000000005c9b94 in instantiate_pending_templates (retries=1) at
../../gcc/cp/pt.c:17884
#6  0x0000000000647e2c in cp_write_global_declarations () at
../../gcc/cp/decl2.c:3719

ICEs because current_class_ptr is NULL.  Jason, as this is a regression from
4.6.0, it might be desirable to fix it for 4.6.1 instead of deferring for
4.6.2.


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
  2011-06-23  9:51 ` [Bug c++/49507] [4.6/4.7 Regression] " jakub at gcc dot gnu.org
@ 2011-06-23 14:29 ` jason at gcc dot gnu.org
  2011-06-23 15:10 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-23 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-23 14:28:00 UTC ---
For 4.6.1 let's just revert r174159.  Will you do that or shall I?


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
  2011-06-23  9:51 ` [Bug c++/49507] [4.6/4.7 Regression] " jakub at gcc dot gnu.org
  2011-06-23 14:29 ` jason at gcc dot gnu.org
@ 2011-06-23 15:10 ` jason at gcc dot gnu.org
  2011-06-23 16:55 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-23 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-23 15:10:01 UTC ---
Created attachment 24586
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24586
fix

Actually, this patch seems safe enough for 4.6.1.  Testing now.


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
                   ` (2 preceding siblings ...)
  2011-06-23 15:10 ` jason at gcc dot gnu.org
@ 2011-06-23 16:55 ` jason at gcc dot gnu.org
  2011-06-23 16:56 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-23 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-23 16:53:06 UTC ---
Author: jason
Date: Thu Jun 23 16:53:03 2011
New Revision: 175342

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175342
Log:
    PR c++/49507
    * decl2.c (mark_used): Don't call synthesize_method for
    functions defaulted outside the class.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/defaulted30.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
                   ` (3 preceding siblings ...)
  2011-06-23 16:55 ` jason at gcc dot gnu.org
@ 2011-06-23 16:56 ` jason at gcc dot gnu.org
  2011-06-24 10:26 ` sefi@s-e-f-i.de
  2011-06-24 19:56 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-06-23 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-23 16:56:31 UTC ---
Author: jason
Date: Thu Jun 23 16:56:27 2011
New Revision: 175343

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175343
Log:
    PR c++/49507
    * decl2.c (mark_used): Don't call synthesize_method for
    functions defaulted outside the class.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/defaulted30.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/decl2.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
                   ` (4 preceding siblings ...)
  2011-06-23 16:56 ` jason at gcc dot gnu.org
@ 2011-06-24 10:26 ` sefi@s-e-f-i.de
  2011-06-24 19:56 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: sefi@s-e-f-i.de @ 2011-06-24 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Philipp <sefi@s-e-f-i.de> 2011-06-24 10:26:06 UTC ---
Applying the changes on top of gcc-4.6.1 rc1 fixes the problem for me.
Thanks!


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

* [Bug c++/49507] [4.6/4.7 Regression] ICE because of defaulted template destructor
  2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
                   ` (5 preceding siblings ...)
  2011-06-24 10:26 ` sefi@s-e-f-i.de
@ 2011-06-24 19:56 ` jakub at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-06-24 19:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-24 19:55:26 UTC ---
Fixed.


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

end of thread, other threads:[~2011-06-24 19:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-22 21:03 [Bug c++/49507] New: ICE because of defaulted template destructor sefi@s-e-f-i.de
2011-06-23  9:51 ` [Bug c++/49507] [4.6/4.7 Regression] " jakub at gcc dot gnu.org
2011-06-23 14:29 ` jason at gcc dot gnu.org
2011-06-23 15:10 ` jason at gcc dot gnu.org
2011-06-23 16:55 ` jason at gcc dot gnu.org
2011-06-23 16:56 ` jason at gcc dot gnu.org
2011-06-24 10:26 ` sefi@s-e-f-i.de
2011-06-24 19:56 ` jakub 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).