This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR debug/82509
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 19 Oct 2017 10:11:11 +0200
- Subject: Re: [patch] Fix PR debug/82509
- Authentication-results: sourceware.org; auth=none
- References: <14641386.x2jigZTk3C@polaris> <CAFiYyc3TC35AcUN8rZT9YK85mheb+Nrrv041zH4YeX=9zNG63g@mail.gmail.com> <79388162.JfDgezjRrN@polaris>
On Wed, Oct 18, 2017 at 3:54 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Hmm. It makes tracking DIE builds difficult now that not all allocations go
>> through new_die anymore.
>
> I wouldn't have created such a precedent though, IOW there is nothing new.
Ah, didn't notice the other existing cases.
>> Can you instead split out a new_die_raw
>> function with just the allocation and the die_tag initialization? Or make
>> !parent_die && !t this mode, thus add
>>
>> if (parent_die != NULL)
>> add_child_die (parent_die, die);
>> else if (! t)
>> return die;
>> else
>> {
>>
>> ? Otherwise the patch looks sensible.
>
> Here's a revision version which makes sure that there is a single call to
>
> ggc_cleared_alloc<die_node> ()
>
> in the entire file. Tested on x86_64-suse-linux.
Thanks, this is ok.
Richard.
>
> PR debug/82509
> * dwarf2out.c (new_die_raw): New static inline function.
> (new_die): Use it to create the DIE.
> (add_AT_external_die_ref): Likewise.
> (clone_die): Likewise.
> (clone_as_declaration): Likewise.
> (dwarf2out_vms_debug_main_pointer): Likewise.
> (base_type_die): Likewise. Remove early return for corner cases.
> Do not call add_pubtype on the DIE here.
> (is_base_type): Remove ERROR_MARK and return 0 for VOID_TYPE.
> (modified_type_die): Adjust the lookup for reverse order DIEs. Skip
> typedefs for base types with DW_AT_endianity. Make sure a DIE with
> native order exists for base types, attach the DIE manually and call
> add_pubtype on it. Do not equate a reverse order DIE to the type.
>
> --
> Eric Botcazou