public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Pierre-Marie de Rodat <derodat@adacore.com>
Cc: Jason Merrill <jason@redhat.com>,
	gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] [PR79542][Ada] Fix ICE in dwarf2out.c with nested func. inlining
Date: Tue, 15 Aug 2017 12:38:00 -0000	[thread overview]
Message-ID: <CAFiYyc1nGSYGmEUuV=G9YTc89YOEqCEQgNJVQ9AR=+hpEU715A@mail.gmail.com> (raw)
In-Reply-To: <2218947e-e30b-cc03-1421-27a17b8b7042@adacore.com>

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

  reply	other threads:[~2017-08-15 11:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 12:25 Pierre-Marie de Rodat
2017-03-22 17:32 ` [PING][PATCH][PR79542][Ada] " Pierre-Marie de Rodat
2017-04-20  9:47   ` [PING*2][PATCH][PR79542][Ada] " Pierre-Marie de Rodat
2017-05-03 19:37 ` [PATCH] [PR79542][Ada] " Jason Merrill
2017-05-08 16:41   ` Jason Merrill
2017-05-26 14:13     ` Pierre-Marie de Rodat
2017-06-16 16:37       ` Pierre-Marie de Rodat
2017-07-24  7:41         ` [PING*2][PATCH] " Pierre-Marie de Rodat
2017-07-31  8:49           ` [PING*3][PATCH] " Pierre-Marie de Rodat
2017-08-07 18:42       ` [PATCH] " Jason Merrill
2017-08-11 14:36         ` Pierre-Marie de Rodat
2017-08-12  8:21           ` Jason Merrill
2017-08-12 14:16             ` Pierre-Marie de Rodat
2017-08-15 12:38               ` Richard Biener [this message]
2017-08-18 10:39                 ` Richard Biener
2017-09-04  9:22                   ` Pierre-Marie de Rodat
2017-09-04  9:26                     ` Richard Biener
2017-09-05 11:05                       ` Pierre-Marie de Rodat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc1nGSYGmEUuV=G9YTc89YOEqCEQgNJVQ9AR=+hpEU715A@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=derodat@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).