Hi! Since it seems the crash appears at a rather normal place in the code (no ET magic or so) I have no idea what might have gone wrong, sorry. Configured with: ../gcc/configure --prefix=/opt/FREE-SOFTWARE/gcc-20030715 --with-gnu-as --with-as=/opt/FREE-SOFTWARE/binutils-2.14/bin/as --with-out-gnu-ld --enable-languages=c,c++ --enable-version-specific-runtime-libs --disable-multilib Thread model: single gcc version 3.4 20030715 (experimental) I attach the .ii file in a minute (why is this button missing in this form?) Mrkus
Created attachment 4406 [details] the input file that triggers the crash
I can reproduce it on powerpc-apple-darwin6.6 with the backtrace: #0 convert_from_reference (val=0x282cf00) at /Volumes/UFS_Partition/pinskia/src/fsf/ gcc-clean/src/gcc/cp/cvt.c:570 #1 0x00037eb0 in tsubst_copy_and_build (t=0x282cf00, args=0x0, complain=tf_error, in_decl=0x0, function_p=false) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/ gcc/cp/pt.c:8358 #2 0x0003826c in tsubst_copy_and_build (t=0x282cf00, args=0x0, complain=tf_error, in_decl=0x0, function_p=false) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/ gcc/cp/pt.c:8068 #3 0x00068bd4 in cp_parser_fold_non_dependent_expr.473 (expr=0x282cf00) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:13852 #4 0x0006491c in cp_parser_direct_declarator.495 (parser=0x282cf00, dcl_kind= CP_PARSER_DECLARATOR_NAMED, ctor_dtor_or_conv_p=0x0) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:9696 #5 0x00064444 in cp_parser_declarator.428 (parser=0x480000, dcl_kind=42127104, ctor_dtor_or_conv_p=0x0) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/ cp/parser.c:9490 #6 0x00063f70 in cp_parser_init_declarator.449 (parser=0x2, decl_specifiers=0x0, prefix_attributes=0x451744, function_definition_allowed_p=true, member_p=false, function_definition_p=0x0) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/ cp/parser.c:9172 #7 0x00060aa0 in cp_parser_simple_declaration.434 (parser=0x282cf00, function_definition_allowed_p=4718592) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc- clean/src/gcc/cp/parser.c:6109 #8 0x0006096c in cp_parser_block_declaration.435 (parser=0x282cf00, statement_p= 4718592) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:6035 #9 0x000604c0 in cp_parser_declaration_statement.423 (parser=0x282cf00) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5754 #10 0x0005f9f8 in cp_parser_statement.417 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5176 #11 0x0005fdb0 in cp_parser_statement_seq_opt.425 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5327 #12 0x0005fd44 in cp_parser_compound_statement.343 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5300 #13 0x0006053c in cp_parser_implicitly_scoped_statement.427 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5788 #14 0x0005ff70 in cp_parser_selection_statement.419 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5398 #15 0x0005fb48 in cp_parser_statement.417 (parser=0x2996120) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5128 #16 0x0005fdb0 in cp_parser_statement_seq_opt.425 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5327 #17 0x0005fd44 in cp_parser_compound_statement.343 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5300 #18 0x0005fb34 in cp_parser_statement.417 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5164 #19 0x000602a8 in cp_parser_iteration_statement.420 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5612 #20 0x0005fb54 in cp_parser_statement.417 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5134 #21 0x0005fdb0 in cp_parser_statement_seq_opt.425 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5327 #22 0x0005fd44 in cp_parser_compound_statement.343 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5300 #23 0x0005fb34 in cp_parser_statement.417 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5164 #24 0x000602a8 in cp_parser_iteration_statement.420 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5612 #25 0x0005fb54 in cp_parser_statement.417 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5134 #26 0x0005fdb0 in cp_parser_statement_seq_opt.425 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5327 #27 0x0005fd44 in cp_parser_compound_statement.343 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5300 #28 0x0006053c in cp_parser_implicitly_scoped_statement.427 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5788 #29 0x0005ff70 in cp_parser_selection_statement.419 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5398 #30 0x0005fb48 in cp_parser_statement.417 (parser=0x2981f00) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5128 #31 0x0005fdb0 in cp_parser_statement_seq_opt.425 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5327 #32 0x0005fd44 in cp_parser_compound_statement.343 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5300 #33 0x00065664 in cp_parser_ctor_initializer_opt_and_function_body.505 (parser= 0x141cb60) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/ parser.c:10713 #34 0x000681f4 in cp_parser_function_definition_after_declarator.526 (parser= 0x141cb60, inline_p=false) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/ cp/parser.c:13390 #35 0x00068134 in cp_parser_function_definition_from_specifiers_and_declarator.490 (parser=0x141cb60, decl_specifiers=0x0, attributes=0x1, declarator=0x0) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:13336 #36 0x000655cc in cp_parser_function_definition.501 (parser=0x141cb60, friend_p= 0xbffff648) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:10682 #37 0x0006864c in cp_parser_single_declaration.474 (parser=0x141cb60, member_p= false, friend_p=0xbffff648) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/ parser.c:13564 #38 0x00068328 in cp_parser_template_declaration_after_export.462 (parser= 0x141cb60, member_p=false) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/ gcc/cp/parser.c:13450 #39 0x00068440 in cp_parser_template_declaration_after_export.462 (parser= 0x141cb60, member_p=false) at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/ gcc/cp/parser.c:13447 #40 0x0006087c in cp_parser_declaration.436 (parser=0x0) at /Volumes/UFS_Partition/ pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5931 #41 0x00060664 in cp_parser_declaration_seq_opt.340 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5864 #42 0x00063838 in cp_parser_namespace_definition.441 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:8787 #43 0x00060888 in cp_parser_declaration.436 (parser=0x141cb60) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5950 #44 0x00060664 in cp_parser_declaration_seq_opt.340 (parser=0x141cb60) at / Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:5864 #45 0x0005cac8 in cp_parser_translation_unit.339 (parser=0x4516b0) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/cp/parser.c:2141 #46 0x0006942c in c_parse_file () at /Volumes/UFS_Partition/pinskia/src/fsf/gcc-clean/ src/gcc/cp/parser.c:14277 #47 0x000b369c in c_common_parse_file (set_yydebug=42127104) at /Volumes/ UFS_Partition/pinskia/src/fsf/gcc-clean/src/gcc/c-opts.c:1216 #48 0x000cc3c4 in compile_file.307 () at /Volumes/UFS_Partition/pinskia/src/fsf/gcc- clean/src/gcc/toplev.c:1930 #49 0x000d17fc in do_compile.353 () at /Volumes/UFS_Partition/pinskia/src/fsf/gcc- clean/src/gcc/toplev.c:4771 #50 0x000d1930 in toplev_main (argc=12, argv=0xbffffbdc) at /Volumes/UFS_Partition/ pinskia/src/fsf/gcc-clean/src/gcc/toplev.c:4812 #51 0x00002178 in _start (argc=12, argv=0xbffffbdc, envp=0xbffffbdc) at /SourceCache/ Csu/Csu-45/crt.c:267 Looks to be target independent. I do not have time right now to reduce it.
OK, this is as small sas I can get it: ------------------------------------ template <typename> class X; template<class T> void foo() { const unsigned int j = T().begin()->first; X<int> v; v[j].push_back(0); } ------------------------------------- With tonight's compiler, I get tmp/gg> ../build-gcc/gcc-install/bin/c++ -c x.cc x.cc: In function `void foo()': x.cc:7: internal compiler error: Segmentation fault Please submit a full bug report, Note that this happens during template parsing time, not during instantiation. I guess the code as is is illegal (since X is not defined at the point of use, but the original code looked definitely legal). W.
With the small test case and with Phil's regression hunter: Search converges between 2003-07-08- trunk (#330) and 2003-07-09-trunk (#331).
Subject: Bug 11525 CVSROOT: /cvs/gcc Module name: gcc Changes by: nathan@gcc.gnu.org 2003-08-01 09:10:29 Modified files: gcc/cp : parser.c ChangeLog gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/parse: constant4.C Log message: cp: PR c++/11525 * parser.c (cp_parser_primary_expression): Do not set non-constant-p merely because it is a dependent scope. testsuite: PR c++/11525 * g++.dg/parse/constant4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.93&r2=1.94 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3574&r2=1.3575 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2939&r2=1.2940 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/constant4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
PR c++/11525 * parser.c (cp_parser_primary_expression): Do not set non-constant-p merely because it is a dependent scope.