This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][C++] Avoid PCH dependent mangling
- From: Richard Biener <rguenther at suse dot de>
- To: Jason Merrill <jason at redhat dot com>,gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Sep 2015 18:49:55 +0200
- Subject: Re: [PATCH][C++] Avoid PCH dependent mangling
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1508271529390 dot 4884 at zhemvz dot fhfr dot qr> <55F82A61 dot 30008 at redhat dot com>
On September 15, 2015 4:25:37 PM GMT+02:00, Jason Merrill <jason@redhat.com> wrote:
>On 08/27/2015 09:36 AM, Richard Biener wrote:
>>
>> With the passes.c hunk in the patch below we FAIL assembly comparison
>> of g++.dg/pch/system-[12].C because with PCH we have computed
>> DECL_ASSEMBLER_NAME and thus appended DW_AT_linkage_name early during
>> PCH generation while without PCH we compute it lazily and end up
>> appending DW_AT_specification earlier. Thus we have swapped dwarf
>> attribute order and assembly comparison fails.
>>
>> Clearly this kind of "IL" changes dependent on whether we are writing
>> a PCH file is going to cause differences down the food chain.
>> (there is another case in instantiate_decl calling
>add_pending_template
>> dependent on pch_file)
>>
>> Now a simple solution is to simply not do that (mangle decls).
>Another
>> would be to always mangle decls where we now do so conditional on
>PCH.
>> Another soulution is to declare we don't care about assembly
>differences
>> with/without using PCH and remove assembly comparison from the
>> testsuite harness.
>
>Hmm, what if we walk through the symtab and mangle everything later,
>when we're about to write the PCH? That should still get the benefit
>of
>doing the mangling work only once, without changing the order of the
>attributes.
That might work if we can get at all relevant decls that way. If not we can populate a pointer-set from the function and walk that before writing the PCH. I can do that if you prefer, I just didn't know if we care about PCH performance enough to worry.
Thanks,
Richard.
>
>Jason