public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: Jeff Law <law@redhat.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	       Jakub Jelinek <jakub@redhat.com>,
	Petr Machata <pmachata@redhat.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PR58315] reset inlined debug vars at return-to point
Date: Tue, 10 Mar 2015 16:35:00 -0000	[thread overview]
Message-ID: <or1tkwbyk7.fsf@livre.home> (raw)
In-Reply-To: <54FDD5C3.5090301@redhat.com> (Jeff Law's message of "Mon, 09 Mar	2015 11:17:55 -0600")

On Mar  9, 2015, Jeff Law <law@redhat.com> wrote:

> On 03/09/15 08:38, Richard Biener wrote:
>> On Fri, Mar 6, 2015 at 7:04 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
>>> On Feb 26, 2015, Alexandre Oliva <aoliva@redhat.com> wrote:
>>> 
>>>> So far, all the differences I looked at were caused by padding at the
>>>> end of BBs, and by jump stmts without line numbers at the end of BBs,
>>>> both right after the debug reset stmts the proposed patch introduces.
>>> 
>>> Further investigation showed there were other sources of spurious
>>> differences:
>>> 
>>> - copies arising from the expansion of PHI nodes; source code
>>> information associated with these copies points at the source of the
>>> copy, which is hardly useful and sensible.
>> 
>> Care to explain?  We spend quite some resources to maintain them
>> (locations on PHI args, that is).

The situation I remember, for looking more extensively into, involved a
variable local to the inlined function, a copy of that variable to a
caller's variable, and that caller's variable being further modified
elsewhere.

We coalesced the two variables into one, removed the copy statement
altogether, and the location from the initial set within the inline
function made it to PHI nodes related with the caller's variable, and
that survived various PHI recomputations due to various CFG
reorganizations.  When the time came to expand the PHI nodes, copies
were required and line number info internal to the inlined function was
added to the copy arising from the edge that had in it the SSA name set
inside the inline function.  And so the ranges of the inline function
were extended far past its actual end, because a coalesced copy from one
of its variables was optimized away and then reintroduced with line
number info pertaining to the inlined function.

> I almost responded to that claim as well, but then thought better of
> it as that patch (AFAICT) wasn't proposed for inclusion, but was being
> used for testing purposes.

The patch that removed line number annotation from copies arising from
expanding PHI nodes was included only for reference, yes.  The upthread
patch for PR58315 still stands.

> Expansion of the PHI into copies should have locations which point to
> the source of the various PHI args.  Those are quite meaningful.

I can see those can be meaningful in many cases.  Not in the ones I
looked at as part of investigating the coverage changes, though.  We
have a substantial number of copies that arise from processes like the
one I described above, and those are most certainly not sensible, mainly
because the relevant line number info was dropped on the floor along
with copies optimized away due to coalescing of variables from different
scopes.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer

  reply	other threads:[~2015-03-10 16:35 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 [this message]
2015-02-26 10:46           ` Richard Biener
2015-02-26 10:46             ` Jakub Jelinek
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=or1tkwbyk7.fsf@livre.home \
    --to=aoliva@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    --cc=pmachata@redhat.com \
    --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).