On Fri, May 22, 2015 at 4:12 PM, Aldy Hernandez <al...@redhat.com> wrote: > On 05/22/2015 07:23 AM, Richard Biener wrote: >> >> On Wed, May 20, 2015 at 5:50 PM, Aldy Hernandez <al...@redhat.com> wrote: >>> >>> On 05/18/2015 06:56 AM, Richard Biener wrote: > > >>>> diff --git a/gcc/tree-core.h b/gcc/tree-core.h >>>> index ad1bb23..2a9f417 100644 >>>> --- a/gcc/tree-core.h >>>> +++ b/gcc/tree-core.h >>>> @@ -1334,6 +1334,9 @@ struct GTY(()) tree_block { >>>> tree abstract_origin; >>>> tree fragment_origin; >>>> tree fragment_chain; >>>> + >>>> + /* Pointer to the DWARF lexical block. */ >>>> + struct die_struct *die; >>>> }; >>>> >>>> struct GTY(()) tree_type_common { >>>> >>>> Ick - do we need this? dwarf2out.c has a hashtable to map blocks to >>>> DIEs (which you don't remove in turn). >>> >>> >>> >>> We need a way to reference the early created DIE from late debugging, and >>> we >>> can't use block_map because it gets cloberred across functions. It's >>> currently being released in late debug (dwarf2out_function_decl), >>> that's why you see it not set to NULL in dwarf2out_c_finalize. >>> >>> Also, it uses BLOCK_NUMBERs, which according to the documentation in >>> tree.h, are not guaranteed to be unique across functions. >>> >>> As Honza mentioned, we're already using a DIE map in types through >>> TYPE_SYMTAB_DIE. See lookup_type_die() in dwarf2out.c. >>> >>> Could we leave this as is? >> >> >> But why then not eliminate block_map in favor of using the new ->die >> member? >> Having both looks very odd to me. > > > Oh, I would love to. I just didn't want to rip things apart elsewhere until > I was sure you guys were on board with the approach. > >> Can you cook up a patch for trunk adding that field to tree_block and >> removing >> the block_map map in favor of sth like what we do for >> lookup_type_die/equate_type_number_to_die >> and TYPE_SYMTAB_DIE? > > > Absolutely! The attached patch removes block_map in favor of BLOCK_DIE. I > did not add lookup_block_die/equate_block_number_to_die abstractions because > I think BLOCK_DIE is pretty straightforward. > > The attached patch is against mainline. I also ported it to the branch for > testing, and neither the branch nor mainline exhibit any regressions. > > Tested on x86-64 Linux with --enable-languages=all,go,ada. > > OK for trunk?
Ok. Thanks, Richard. > Aldy >