public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: Dinar Temirbulatov <dtemirbulatov@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: MIPS Fix PR18141
Date: Wed, 21 Sep 2011 13:30:00 -0000	[thread overview]
Message-ID: <g4hb46kq51.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> (raw)
In-Reply-To: <CAMnfPmOa=aBBKkvAn3=FxaLfK_kSuNQxBZcDWqHZhnORHmFqDw@mail.gmail.com>	(Dinar Temirbulatov's message of "Wed, 21 Sep 2011 16:45:10 +0400")

Dinar Temirbulatov <dtemirbulatov@gmail.com> writes:
> @@ -14696,7 +14696,11 @@ mips_avoid_hazard (rtx after, rtx insn,
>       clobber hi and lo.  */
>    if (*hilo_delay < 2 && reg_set_p (lo_reg, pattern))
>      nops = 2 - *hilo_delay;
> -  else if (*delayed_reg != 0 && reg_referenced_p (*delayed_reg, pattern))
> +  else if ((*delayed_reg != 0 && reg_referenced_p (*delayed_reg, pattern))
> +	    && !((GET_MODE (*delayed_reg) == DFmode && set_after != 0
> +            && (set = single_set (insn)) != NULL_RTX && GET_MODE (SET_DEST(set)) == DFmode
> +            && XINT((XEXP (pattern, 1)), 1) == UNSPEC_LOAD_HIGH 
> +            && XINT((XEXP (*set_after, 1)), 1) == UNSPEC_LOAD_LOW)))

This isn't safe because the patterns might not be UNSPECs (so XINT (...)
would be meaningless).  It's better to check the insn code instead.
Something like:

  else if (*delayed_reg != 0
	   && reg_referenced_p (*delayed_reg, pattern)
	   && !(recog_memoized (insn) == CODE_FOR_load_highdf
		&& recog_memoized (*set_after) == CODE_FOR_load_lowdf))

(untested).  Note that *set_after should always be nonnull if
*delayed_reg is.

Looks good otherwise.

Richard

       reply	other threads:[~2011-09-21 12:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMnfPmOfRz+-nPAsWk3iV2=fvF82A157Own02gaJD-YS40Vf4Q@mail.gmail.com>
     [not found] ` <g47h5bi5ip.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com>
     [not found]   ` <CAMnfPmOa=aBBKkvAn3=FxaLfK_kSuNQxBZcDWqHZhnORHmFqDw@mail.gmail.com>
2011-09-21 13:30     ` Richard Sandiford [this message]
2011-09-23 13:48       ` Dinar Temirbulatov
2011-09-23 19:58         ` Dinar Temirbulatov
2011-09-26  9:04           ` Richard Sandiford
2011-09-27  7:48             ` Dinar Temirbulatov
2011-09-27  9:48               ` Richard Sandiford

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=g4hb46kq51.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com \
    --to=rdsandiford@googlemail.com \
    --cc=dtemirbulatov@gmail.com \
    --cc=gcc-patches@gcc.gnu.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).