./cc1plus -quiet -O2 bug-343711_storage.min.ii Program received signal SIGSEGV, Segmentation fault. 0x00000000010aa445 in htab_find_with_hash (htab=0x0, element=0x2b7075926540, hash=246566056) at /space/rguenther/src/svn/trunk/libiberty/hashtab.c:566 566 htab->searches++; (gdb) up #1 0x000000000047ab19 in retrieve_local_specialization (tmpl=0x2b7075926540) at /space/rguenther/src/svn/trunk/gcc/cp/pt.c:979 979 htab_hash_pointer (tmpl));
Created attachment 14626 [details] reduced testcase
*** Bug 34208 has been marked as a duplicate of this bug. ***
Introduced by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128681
In particular, this is caused by the pt.c (tsubst) change: @@ -8555,16 +8545,15 @@ gcc_assert (type != unknown_type_node); /* Reuse typedefs. We need to do this to handle dependent attributes, - specifically attribute aligned. */ + such as attribute aligned. */ if (TYPE_P (t) && TYPE_NAME (t) - && !MAYBE_TAGGED_TYPE_P (t) - && TREE_CODE (t) != TEMPLATE_TEMPLATE_PARM - && TREE_CODE (t) != UNBOUND_CLASS_TEMPLATE) + && TYPE_NAME (t) != TYPE_MAIN_DECL (t)) { tree decl = TYPE_NAME (t); - if (DECL_CLASS_SCOPE_P (decl)) + if (DECL_CLASS_SCOPE_P (decl) + && CLASSTYPE_TEMPLATE_INFO (DECL_CONTEXT (decl))) { tree tmpl = most_general_template (DECL_TI_TEMPLATE (decl)); tree gen_args = tsubst (DECL_TI_ARGS (decl), args, complain, in_decl); r = retrieve_specialization (tmpl, gen_args, false); } else if (DECL_FUNCTION_SCOPE_P (decl)) r = retrieve_local_specialization (decl); else r = NULL_TREE; In this case t is RECORD_TYPE in function scope, so MAYBE_TAGGED_TYPE_P was true on it, but this (fn_type_unification) wasn't called from instantiate_decl and so local_specializations is NULL. I wonder if just - else if (DECL_FUNCTION_SCOPE_P (decl)) + else if (DECL_FUNCTION_SCOPE_P (decl) && local_specializations) wouldn't be best fix for this, there are already other places which guard retrieve_local_specialization calls by this condition.
Subject: Bug 34206 Author: jason Date: Tue Dec 18 22:25:20 2007 New Revision: 131044 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131044 Log: PR c++/34206 * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't use template parms. (dependent_type_p_r): Handle the domain of an array. Added: trunk/gcc/testsuite/g++.dg/template/typedef8.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c
fixed
*** Bug 34541 has been marked as a duplicate of this bug. ***