User account creation filtered due to spam.

Bug 43868 - [4.5/4.6 Regression] ICE with -g
Summary: [4.5/4.6 Regression] ICE with -g
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.1
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2010-04-23 16:30 UTC by Joachim Reichel
Modified: 2010-05-04 04:43 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2010-04-30 18:59:47


Attachments
test case (276 bytes, text/plain)
2010-04-23 16:31 UTC, Joachim Reichel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Reichel 2010-04-23 16:30:54 UTC
"g++ -c code.i" works, "g++ -c -g code.i" gives

tmp/code.i: In instantiation of 'Foo_impl<int (Bar::*)()const>::Helper':
tmp/code.i:19:27:   instantiated from 'void Foo_impl<R (O::*)()const>::do_something() [with R = int, O = Bar]'
tmp/code.i:34:1:   instantiated from here
tmp/code.i:13:5: internal compiler error: Segmentation fault

This is a regression against g++ 4.4.x.

Replacing Some_type by int works. An empty body for do_something() works as well.

g++ -v:

Using built-in specs.
COLLECT_GCC=/some/prefix/gcc-4.5.0/x86_64-unknown-linux-gnu/bin/g++
COLLECT_LTO_WRAPPER=/some/prefix/gcc-4.5.0/x86_64-unknown-linux-gnu/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/some/prefix/gcc-4.5.0
--exec-prefix=/some/prefix/gcc-4.5.0/x86_64-unknown-linux-gnu
--enable-version-specific-runtime-libs --enable-stage1-checking
--disable-nls --with-system-zlib --enable-multilib
--enable-languages=c,c++,objc
--with-gmp-include=/some/prefix/gmp-4.2.2/x86_64-unknown-linux-gnu/include
--with-gmp-lib=/some/prefix/gmp-4.2.2/x86_64-unknown-linux-gnu/lib
--with-mpfr-include=/some/prefix/mpfr-2.4.2/include
--with-mpfr-lib=/some/prefix/mpfr-2.4.2/x86_64-unknown-linux-gnu/lib
--with-mpc-include=/some/prefix/mpc-0.8.1/include
--with-mpc-lib=/some/prefix/mpc-0.8.1/x86_64-unknown-linux-gnu/lib
--with-gnu-as
--with-as=/some/prefix/binutils-2.20.1/x86_64-unknown-linux-gnu/bin/as
--with-gnu-ld
--with-ld=/some/prefix/binutils-2.20.1/x86_64-unknown-linux-gnu/bin/ld
Thread model: posix
gcc version 4.5.0 (GCC)
Comment 1 Joachim Reichel 2010-04-23 16:31:53 UTC
Created attachment 20473 [details]
test case
Comment 2 Richard Biener 2010-04-23 16:35:42 UTC
Confirmed.

Program received signal SIGSEGV, Segmentation fault.
0x00000000007541dd in pp_cxx_unqualified_id (pp=0x18e1280, t=0x0)
    at /space/rguenther/src/svn/trunk/gcc/cp/cxx-pretty-print.c:150
150       enum tree_code code = TREE_CODE (t);
(gdb) bt
#0  0x00000000007541dd in pp_cxx_unqualified_id (pp=0x18e1280, t=0x0)
    at /space/rguenther/src/svn/trunk/gcc/cp/cxx-pretty-print.c:150
#1  0x0000000000754634 in pp_cxx_unqualified_id (pp=0x18e1280, 
    t=0x7ffff5b48a80)
    at /space/rguenther/src/svn/trunk/gcc/cp/cxx-pretty-print.c:202
#2  0x000000000075602d in pp_cxx_qualified_id (pp=0x18e1280, t=0x7ffff5b48a80)
    at /space/rguenther/src/svn/trunk/gcc/cp/cxx-pretty-print.c:319
#3  0x000000000075ac83 in pp_cxx_simple_type_specifier (pp=0x18e1280, 
    t=0x7ffff5b48a80)
    at /space/rguenther/src/svn/trunk/gcc/cp/cxx-pretty-print.c:1220
#4  0x00000000007c1f5c in pp_c_specifier_qualifier_list (pp=0x18e1280, 
    t=0x7ffff5b48a80)
    at /space/rguenther/src/svn/trunk/gcc/c-pretty-print.c:471
...
#18 0x000000000061a524 in dump_type (t=0x7ffff5b5abd0, flags=0)
    at /space/rguenther/src/svn/trunk/gcc/cp/error.c:383
#19 0x0000000000623f9f in dump_function_name (t=0x7ffff5b53400, flags=0)
    at /space/rguenther/src/svn/trunk/gcc/cp/error.c:1430
#20 0x000000000062b382 in lang_decl_name (decl=0x7ffff5b53400, v=0, 
    translate=0 '\000') at /space/rguenther/src/svn/trunk/gcc/cp/error.c:2361
#21 0x00000000006fa0e7 in cxx_printable_name_internal (decl=0x7ffff5b53400, 
    v=0, translate=0 '\000')
    at /space/rguenther/src/svn/trunk/gcc/cp/tree.c:1406
#22 0x00000000006fa3db in cxx_printable_name (decl=0x7ffff5b53400, v=0)
    at /space/rguenther/src/svn/trunk/gcc/cp/tree.c:1443
#23 0x00000000004a0e5e in cxx_dwarf_name (t=0x7ffff5b53400, verbosity=0)
    at /space/rguenther/src/svn/trunk/gcc/cp/cp-lang.c:148
#24 0x00000000008d3838 in dwarf2_name (decl=0x7ffff5b53400, scope=0)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:10848
#25 0x00000000008e5570 in add_name_and_src_coords_attributes (
    die=0x7ffff5b57e70, decl=0x7ffff5b53400)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16802
#26 0x00000000008e9483 in gen_subprogram_die (decl=0x7ffff5b53400, 
    context_die=0x7ffff5b57dc0)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:17960
#27 0x00000000008efcd7 in gen_decl_die (decl=0x7ffff5b53400, 
Comment 3 H.J. Lu 2010-04-24 13:47:21 UTC
It is caused by revision 153978:

http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00196.html
Comment 4 Jason Merrill 2010-04-30 20:48:51 UTC
Subject: Bug 43868

Author: jason
Date: Fri Apr 30 20:48:12 2010
New Revision: 158947

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158947
Log:
	PR c++/43868
	* cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
	(pp_cxx_type_specifier_seq): ...here.

Added:
    trunk/gcc/testsuite/g++.dg/template/ptrmem21.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cxx-pretty-print.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jason Merrill 2010-04-30 21:25:20 UTC
Subject: Bug 43868

Author: jason
Date: Fri Apr 30 21:24:27 2010
New Revision: 158952

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158952
Log:
	PR c++/43868
	* cxx-pretty-print.c (pp_cxx_type_specifier_seq): Handle pmfs.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/template/ptrmem21.C
Modified:
    branches/gcc-4_5-branch/gcc/cp/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/cxx-pretty-print.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Comment 6 Jason Merrill 2010-05-04 04:43:01 UTC
Fixed for 4.5.1.