On Tue, Aug 15, 2017 at 1:16 PM, Richard Biener
<richard.guent...@gmail.com> wrote:
> On Sat, Aug 12, 2017 at 11:09 AM, Pierre-Marie de Rodat
> <dero...@adacore.com> wrote:
>> On 08/11/2017 11:29 PM, Jason Merrill wrote:
>>>
>>> OK.
>>
>>
>> Committed. Thank you for your sustained review effort, Jason. :-)
>
> The way you use decl_ultimate_origin conflicts with the early LTO
> debug patches which
> make dwarf2out_abstract_function call set_decl_origin_self and thus the assert
> in gen_typedef_die triggers (and the rest probably misbehaves).
>
> Now I wonder whether we at any point need that self-origin?
>
> Currently it's set via
>
> static dw_die_ref
> gen_decl_die (tree decl, tree origin, struct vlr_context *ctx,
>               dw_die_ref context_die)
> {
> ...
>     case FUNCTION_DECL:
> #if 0
>       /* FIXME */
>       /* This doesn't work because the C frontend sets DECL_ABSTRACT_ORIGIN
>          on local redeclarations of global functions.  That seems broken.  */
>       if (current_function_decl != decl)
>         /* This is only a declaration.  */;
> #endif
>
>       /* If we're emitting a clone, emit info for the abstract instance.  */
>       if (origin || DECL_ORIGIN (decl) != decl)
>         dwarf2out_abstract_function (origin
>                                      ? DECL_ORIGIN (origin)
>                                      : DECL_ABSTRACT_ORIGIN (decl));
>
>       /* If we're emitting an out-of-line copy of an inline function,
>          emit info for the abstract instance and set up to refer to it.  */
>       else if (cgraph_function_possibly_inlined_p (decl)
>                && ! DECL_ABSTRACT_P (decl)
>                && ! class_or_namespace_scope_p (context_die)
>                /* dwarf2out_abstract_function won't emit a die if this is just
>                   a declaration.  We must avoid setting DECL_ABSTRACT_ORIGIN 
> in
>                   that case, because that works only if we have a die.  */
>                && DECL_INITIAL (decl) != NULL_TREE)
>         {
>           dwarf2out_abstract_function (decl);
>           set_decl_origin_self (decl);
>         }
>
> ok, not doing this at all doesn't work, doing it only in the above case 
> neither.
>
> Bah.
>
> Can anyone explain to me why we do the set_decl_origin_self dance?

Ok, so I need the following incremental patch to fix the fallout.

This allows Ada LTO bootstrap to succeed with the early LTO debug patches.

I assume this change is ok ontop of the LTO debug patches unless I
hear otherwise
til Monday (when I then finally will commit the series).

Full bootstrap/testing running now.

Thanks,
Richard.

2017-08-18  Richard Biener  <rguent...@suse.de>

        * dwarf2out.c (modified_type_die): Check for self origin before
        recursing.
        (gen_type_die_with_usage): Likewise.
        (gen_typedef_die): Allow self origin.
        * tree.c (variably_modified_type_p): Guard against Ada recursive
        pointer types.

Attachment: p
Description: Binary data

Reply via email to