public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@linaro.org>
To: Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
Cc: gcc@gcc.gnu.org
Subject: Re: regrename and odd behaviour with early clobber operands
Date: Tue, 16 Aug 2011 15:25:00 -0000	[thread overview]
Message-ID: <m3ty9hs7k1.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <CACUk7=UcpJk2+jPyYGPGVtYv+m9cduBVst-906X89nn0LaAOUA@mail.gmail.com>	(Ramana Radhakrishnan's message of "Tue, 16 Aug 2011 07:40:22 +0100")

Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> writes:
> I can't see how it is right to construct essentially 2 chains for the
> same register that have overlapping live ranges without an intervening
> conditional branch and since regrename sort of works inside a bb .
> Ideally the chain for 122 should have been terminated at the end of
> 123 rather than allowing this to remain open and have the use in insn
> 141 available for use in both chains starting at 122 and 140 . What
> I'm not sure is which part of regrename makes sure that this part of
> the comment for Stage 5 is ensured.
>
>             `and earlier
> 	     chains they would overlap with must have been closed at
> 	     the previous insn at the latest, as such operands cannot
> 	     possibly overlap with any input operands.  */'

Just to summarise on-list what we talked about on IRC: this is supposed
to happen through REG_DEAD notes.  The bug in this case appears to be
that the required note is missing.

The patch below seems to fix things.  If it's right, I'm very surprised
we hadn't noticed until now.  There must be something else going on...

Richard


Index: gcc/df-problems.c
===================================================================
--- gcc/df-problems.c	2011-07-11 12:21:33.000000000 +0100
+++ gcc/df-problems.c	2011-08-16 16:18:52.333237669 +0100
@@ -3376,7 +3376,7 @@ df_note_bb_compute (unsigned int bb_inde
       while (*mws_rec)
 	{
 	  struct df_mw_hardreg *mws = *mws_rec;
-	  if ((DF_MWS_REG_DEF_P (mws))
+	  if ((DF_MWS_REG_USE_P (mws))
 	      && !df_ignore_stack_reg (mws->start_regno))
 	    {
 	      bool really_add_notes = debug_insn != 0;

  reply	other threads:[~2011-08-16 15:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16  6:40 Ramana Radhakrishnan
2011-08-16 15:25 ` Richard Sandiford [this message]
2011-08-18  8:10   ` Ramana Radhakrishnan

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=m3ty9hs7k1.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com \
    --to=richard.sandiford@linaro.org \
    --cc=gcc@gcc.gnu.org \
    --cc=ramana.radhakrishnan@linaro.org \
    /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).