This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] PR debug/66653: avoid late_global_decl on decl_type_context()s
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 26 Jun 2015 11:37:49 +0200
- Subject: Re: [patch] PR debug/66653: avoid late_global_decl on decl_type_context()s
- Authentication-results: sourceware.org; auth=none
- References: <558B71A3 dot 3080004 at redhat dot com> <558C32D7 dot 1090902 at redhat dot com>
On Thu, Jun 25, 2015 at 6:56 PM, Jason Merrill <jason@redhat.com> wrote:
> 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.
Can we defer TLS model setting to template instantiation?
> I guess either we need to avoid putting these templates in the symbol table
> or we need to mark these fake entries somehow.
>
> Jason
>