public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Alexandre Oliva <aoliva@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PR58315] reset inlined debug vars at return-to point
Date: Thu, 26 Feb 2015 10:46:00 -0000	[thread overview]
Message-ID: <20150226104241.GB1746@tucnak.redhat.com> (raw)
In-Reply-To: <CAFiYyc16cJOfeS=TyurCx_x50keHergEgxGT4AcGa9owQnHK-Q@mail.gmail.com>

On Thu, Feb 26, 2015 at 11:29:35AM +0100, Richard Biener wrote:
> I claim you can achieve the same result by effectively inserting
> those reset debug insns right before var-tracking itself and by
> re-computing BLOCK "liveness".  That will automatically deal
> with code motion that extends the life-range of an inlined BLOCK
> by moving stmts (still associated with that BLOCK) across the
> return point of the inlined call (and thus across your debug resets).
> And it will allow var-tracking to eventually compute locations for
> vars at the "entry" of that BLOCK piece.

If that would work, it would be nice, but I'm not sure how you can do that.
Using something like final.c (reemit_insn_block_notes) you can discover
the ranges of scopes (inline functions and lexical blocks).
If some scope has a single range, it is the easy case, you know where it
starts and where it ends.  For scopes with multiple ranges, how can you find
out what case it is though?  I mean, either it can be just the case that
some instruction(s) with different scope got scheduled (or sunk / whatever)
in between the instructions of the scope, in that case resetting the vars
there is highly undesirable (would majorly grow the .debug_loc lists and
break debuggers, e.g. when you try to watch some variable through the live
of some inline, if you reset it any time a single unrelated insn is
encountered, the debugger would need to tell you the var got lost/changed).
Or it can be the case of unrolled loop which has lexical scopes or inlines
in it, in that case you will have multiple "same" scopes, but in that case
it is unnecessary to preserve variables in between those, it is really
different inlines.

	Jakub

  reply	other threads:[~2015-02-26 10:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 10:06 Alexandre Oliva
2015-02-25 11:01 ` Richard Biener
2015-02-25 16:28   ` Jakub Jelinek
2015-02-25 21:22     ` Alexandre Oliva
2015-02-25 21:44       ` Jakub Jelinek
2015-02-26  2:16         ` Alexandre Oliva
2015-02-26  7:37           ` Jakub Jelinek
2015-02-26 16:31             ` Petr Machata
2015-02-27  1:46             ` Alexandre Oliva
2015-02-27 10:19               ` Petr Machata
2015-02-27 22:03                 ` Alexandre Oliva
2015-03-06 18:05               ` Alexandre Oliva
2015-03-09 14:38                 ` Richard Biener
2015-03-09 17:17                   ` Jeff Law
2015-03-10 16:35                     ` Alexandre Oliva
2015-02-26 10:46           ` Richard Biener
2015-02-26 10:46             ` Jakub Jelinek [this message]
2015-02-26 11:03               ` Richard Biener
2015-02-26 17:13                 ` Alexandre Oliva
2015-02-26 16:55             ` Alexandre Oliva
2015-02-26 17:16           ` Alexandre Oliva
2015-02-25 21:13   ` Alexandre Oliva
2015-03-04 15:38 ` Richard Biener
2015-03-05 19:26   ` Alexandre Oliva
2015-03-05 20:27     ` Richard Biener
2015-06-03 22:05 ` Alexandre Oliva
2015-06-08  8:03   ` 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=20150226104241.GB1746@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=aoliva@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).