public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix -fcompare-debug issue in tree profiler (PR debug/46255)
Date: Mon, 01 Nov 2010 23:15:00 -0000	[thread overview]
Message-ID: <20101101230700.GE29412@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <AANLkTikC3tkVh+0cZ1MAZpsgkr3Lq8aNTZRvg8-HGsU_@mail.gmail.com>

On Mon, Nov 01, 2010 at 11:29:57PM +0100, Richard Guenther wrote:
> On Mon, Nov 1, 2010 at 8:21 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > While debug stmts are never considered to need fake edges, it currently
> > (incorrectly) makes a difference whether a stmt that needs fake edges
> > was the last one or not.  Fixed by disregarding any debug stmts
> > at the end of bb.
> >
> > Bootstrapped/regtested on x86_64-linux and i686-linux.  Ok for trunk?
> 
> Hmm, you mean that the stmt needing fake edges doesn't end the BB?

Yes.

> So your patch fixes that by splitting the BB at the appropriate point?

No, that was what the code was doing before and that caused the
-fcompare-debug differences, because without -g the bb was not split, with
-g it was split.
profile.c uses block_ends_with_call_p, which for gimple uses
/* Return true if BB ends with a call, possibly followed by some
   instructions that must stay with the call.  Return false,
   otherwise.  */

static bool
gimple_block_ends_with_call_p (basic_block bb)
{
  gimple_stmt_iterator gsi = gsi_last_nondebug_bb (bb);
  return !gsi_end_p (gsi) && is_gimple_call (gsi_stmt (gsi));
}

Having the fake edge gong not immediately from the call, but
from the end of bb where the call is followed only by debug stmts,
seems to work just fine, all it means is the profiling stuff
gets emitted before or after those debug stmts which really result in
no code being generated.

	Jakub

  reply	other threads:[~2010-11-01 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 19:23 Jakub Jelinek
2010-11-01 23:07 ` Richard Guenther
2010-11-01 23:15   ` Jakub Jelinek [this message]
2010-11-02 10:51     ` Richard Guenther

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=20101101230700.GE29412@tyan-ft48-01.lab.bos.redhat.com \
    --to=jakub@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).