https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61558

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com

--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Jason,
the problem here is that grokdeclaratol call set_decl_tls_model on variable
that is uninstantiated template.
#0  varpool_node::create_empty () at ../../gcc/varpool.c:140
#1  0x00000000011c78d7 in varpool_node::get_create (decl=0x7ffff6ae4bd0) at
../../gcc/varpool.c:154
#2  0x000000000114d09d in set_decl_tls_model (node=0x7ffff6ae4bd0,
model=TLS_MODEL_INITIAL_EXEC) at ../../gcc/tree.c:678
#3  0x00000000006abe02 in grokdeclarator (declarator=0x20fe5b0,
declspecs=0x7fffffffe400, decl_context=FIELD, initialized=0,
attrlist=0x7fffffffe370) at ../../gcc/cp/decl.c:10771
#4  0x000000000077d728 in grokfield (declarator=0x20fe5b0,
declspecs=0x7fffffffe400, init=0x0, init_const_expr_p=true, asmspec_tree=0x0,
attrlist=0x0) at ../../gcc/cp/decl2.c:864
#5  0x00000000007c895d in cp_parser_member_declaration (parser=0x7ffff6c46000)
at ../../gcc/cp/parser.c:20881
#6  0x00000000007c7d2f in cp_parser_member_specification_opt
(parser=0x7ffff6c46000) at ../../gcc/cp/parser.c:20431
#7  0x00000000007c5b18 in cp_parser_class_specifier_1 (parser=0x7ffff6c46000)
at ../../gcc/cp/parser.c:19623
#8  0x00000000007c67cb in cp_parser_class_specifier (parser=0x7ffff6c46000) at
../../gcc/cp/parser.c:19859
#9  0x00000000007bc5ba in cp_parser_type_specifier (parser=0x7ffff6c46000,
flags=1, decl_specs=0x7fffffffe7d0, is_declaration=true,
declares_class_or_enum=0x7fffffffe754, 
    is_cv_qualifier=0x7fffffffe753) at ../../gcc/cp/parser.c:14532
#10 0x00000000007b83b9 in cp_parser_decl_specifier_seq (parser=0x7ffff6c46000,
flags=1, decl_specs=0x7fffffffe7d0, declares_class_or_enum=0x7fffffffe85c) at
../../gcc/cp/parser.c:11774
#11 0x00000000007cd17a in cp_parser_single_declaration (parser=0x7ffff6c46000,
checks=0x0, member_p=false, explicit_specialization_p=false,
friend_p=0x7fffffffe89f)
    at ../../gcc/cp/parser.c:23510
#12 0x00000000007cc91a in cp_parser_template_declaration_after_export
(parser=0x7ffff6c46000, member_p=false) at ../../gcc/cp/parser.c:23379
#13 0x00000000007ba20a in cp_parser_template_declaration
(parser=0x7ffff6c46000, member_p=false) at ../../gcc/cp/parser.c:13069
#14 0x00000000007b7643 in cp_parser_declaration (parser=0x7ffff6c46000) at
../../gcc/cp/parser.c:11166
#15 0x00000000007b738c in cp_parser_declaration_seq_opt (parser=0x7ffff6c46000)
at ../../gcc/cp/parser.c:11096
#16 0x00000000007aaf90 in cp_parser_translation_unit (parser=0x7ffff6c46000) at
../../gcc/cp/parser.c:4059

this triggers creation of symbol node for it that is not correct, because
uninstatiated var decls do not correspond to any variables.
I guess similar case may be triggered by section attribute. I wonder if there
is resonably easy way to avoid setting these properties on DECLs that are not
real variables/functions.

Other alternative would be to arrange symtab_node::real_symbol_p
to return false on those and make them to bypass assembler name hash. Is there
a way to recognize them from a middle-end?

Honza

Reply via email to