[patch] PR debug/66653: avoid late_global_decl on decl_type_context()s
Jason Merrill
jason@redhat.com
Thu Jun 25 17:02:00 GMT 2015
On 06/24/2015 11:12 PM, Aldy Hernandez wrote:
> The problem here is that we are trying to call
> dwarf2out_late_global_decl() on a static variable in a template which
> has a type of TEMPLATE_TYPE_PARM:
>
> template <typename T> class A
> {
> static __thread T a;
> };
>
> We are calling late_global_decl because we are about to remove the
> unused static from the symbol table:
The problem here is that 'a' should never have been in the symbol table
in the first place, since it's an uninstantiated template. It's there
because of honza's change to store the TLS model in the symbol table, so
TLS templates end up with varpool entries that, of course, will never be
referenced.
I guess either we need to avoid putting these templates in the symbol
table or we need to mark these fake entries somehow.
Jason
More information about the Gcc-patches
mailing list