[PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining

Richard Biener richard.guenther@gmail.com
Tue Aug 15 12:38:00 GMT 2017


On Sat, Aug 12, 2017 at 11:09 AM, Pierre-Marie de Rodat
<derodat@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?

Richard.

> --
> Pierre-Marie de Rodat



More information about the Gcc-patches mailing list