On Tue, Sep 07, 2021 at 02:06:29PM +0200, Eric Botcazou wrote:
> this is the recent LTO bootstrap failure with Ada enabled.  The compiler now 
> generates DW_OP_deref_type for a unit of the Ada front-end, which means that 
> the offset of base types in the CU must be computed during early DWARF too.
> 
> LTO-bootstrapped/regtested on x86-64/Linux, OK for the mainline?
> 
> 
> 2021-09-07  Eric Botcazou  <ebotca...@adacore.com>
> 
>       PR debug/101947
>       * dwarf2out.c (mark_base_types): New overloaded function.
>       (dwarf2out_early_finish): Invoke it on the COMDAT type list as well
>       as the compilation unit, and call move_marked_base_types afterward.

>  /* Comparison function for sorting marked base types.  */
>  
>  static int
> @@ -32697,6 +32731,7 @@ ctf_debug_do_cu (dw_die_ref die)
>  static void
>  dwarf2out_early_finish (const char *filename)
>  {
> +  comdat_type_node *ctnode;
>    set_early_dwarf s;
>    char dl_section_ref[MAX_ARTIFICIAL_LABEL_BYTES];
>  
> @@ -32792,8 +32827,7 @@ dwarf2out_early_finish (const char *filename)
>    note_variable_value (comp_unit_die ());
>    for (limbo_die_node *node = cu_die_list; node; node = node->next)
>      note_variable_value (node->die);
> -  for (comdat_type_node *ctnode = comdat_type_list; ctnode != NULL;
> -       ctnode = ctnode->next)
> +  for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next)
>      note_variable_value (ctnode->root_die);
>    for (limbo_die_node *node = limbo_die_list; node; node = node->next)
>      note_variable_value (node->die);
> @@ -32845,6 +32879,11 @@ dwarf2out_early_finish (const char *filename)
>       location related output removed and some LTO specific changes.
>       Some refactoring might make both smaller and easier to match up.  */
>  
> +  for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next)
> +    mark_base_types (ctnode->root_die);

ctnode between the two loops isn't used, so I think it is cleaner to just
use two
  for (comdat_type_node *ctnode = comdat_type_list; ctnode != NULL;
       ctnode = ctnode->next)
loops instead of reusing the iterator variable.

Ok for trunk either way.

        Jakub

Reply via email to