public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PING][PATCH][2/2] Early LTO debug -- main part
Date: Mon, 28 Nov 2016 17:21:00 -0000	[thread overview]
Message-ID: <CADzB+2nObukQSSpUOPTx1qkFnw14hDyd_54coqx=xaQe9tt5cA@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.11.1611241356010.5294@t29.fhfr.qr>

On Thu, Nov 24, 2016 at 8:50 AM, Richard Biener <rguenther@suse.de> wrote:
>> > +      /* ???  We can't annotate types late, but for LTO we may not
>> > +    generate a location early either (gfortran.dg/save_5.f90).
>> > +    The proper way is to handle it like VLAs though it is told
>> > +    that DW_AT_string_length does not support this.  */
>>
>> I think go ahead and handle it like VLAs, this is an obvious generalization
>> and should go into the spec soon enough.  This can happen later.
>
> Ok, note that VLAs are now handled by re-emitting types late to avoid
> some guality regressions.  With inlining VLA types also get copied
> so we'd need to re-design how we handle them a bit.
> I'll see what the DWARF people come up with.

Does the discussion in
https://sourceware.org/bugzilla/show_bug.cgi?id=20426 cover the issue?

>> > +     /* ???  This all (and above) should probably be simply
>> > +        a ! early_dwarf check somehow.  */
>> > +      && ((DECL_ARTIFICIAL (decl) || in_lto_p)
>> >            || (get_AT_file (old_die, DW_AT_decl_file) == file_index
>> >                && (get_AT_unsigned (old_die, DW_AT_decl_line)
>> >                    == (unsigned) s.line))))
>>
>> Why doesn't the existing source position check handle the LTO case? Also the
>> extra parens aren't necessary.
>
> Because in LTRANS we do not see those attributes anymore but they are
> present in the early created DIEs.

Ah, OK.  But the comment seems wrong, since we go through here in
early dwarf for local class methods.

>> > +init_sections_and_labels (bool early_lto_debug)
>>
>> You're changing this function to do the same thing in four slightly different
>> ways rather than two.  I'd rather control each piece as appropriate; we ought
>> to make SECTION_DEBUG or SECTION_DEBUG|SECTION_EXCLUDE a local variable, and
>> select between *_SECTION and the DWO variant at each statement rather than in
>> different blocks.
>
> Note that the section names change between LTO, LTO_DWO, DWO and
> regular section names.  It's basically modeled after what we have now
> which switches between regular and DWO section names.  We might
> be able to refactor this with a new array
>
> enum section_kind { NORMAL, DWO, LTO, LTO_DWO };
> char **section_names[section_kind][] = { { DEBUG_INFO_SECTION, ... },
> { DEBUG_DWO_INFO_SECTION, ... },
> { DEBUG_LTO_INFO_SECTION, ... },
> { DEBUG_LTO_DWO_INFO_SECTION, .. } };
>
> would you prefer that?

That sounds better, thanks.

Jason

  parent reply	other threads:[~2016-11-28 17:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 11:26 [PATCH][2/2] " Richard Biener
2016-11-11  8:07 ` [PING][PATCH][2/2] " Richard Biener
2016-11-22 22:50   ` Jason Merrill
2016-11-24 13:50     ` Richard Biener
2016-11-24 14:57       ` Richard Biener
2016-11-28 17:21       ` Jason Merrill [this message]
2017-05-19 10:33         ` Richard Biener

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='CADzB+2nObukQSSpUOPTx1qkFnw14hDyd_54coqx=xaQe9tt5cA@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).