public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at nildram dot co dot uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/35768] gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload, at reload1.c:7331
Date: Mon, 31 Mar 2008 16:11:00 -0000	[thread overview]
Message-ID: <20080331161101.25070.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35768-276@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from rsandifo at nildram dot co dot uk  2008-03-31 16:11 -------
Subject: Re:  gcc.c-torture/compile/20010226-1.c:22: ICE: in do_output_reload,
at reload1.c:7331

"danglin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
> Richard, does match_scratch now require a mode?  The pattern causing
> the problem was written without a mode so that it could handle both
> SImode and DImode.

Hmm.  Well, the use of a modeless "match_scratch" in a matching context
is OK.  It's the use of a modeless "(scratch)" rtx (and thus a modeless
"match_scratch" in an expander or named insn) that's the problem.

It does seem odd for an output "(scratch)" to have no mode.  From a
quick check, it seems PA is the only port to use voidless "(scratch)"
rtxes for output operands that really do need reloads.  Other ports
either add the mode to the "match_scratch" or get the associated
expander to call "gen_rtx_SCRATCH (mode)".  See s390.md for an
example of the latter.

I suppose the assumption in pa.md is that the scratch output reload
should be in the same mode as the input operand.  However, the point
of my patch was that they needn't be: matched input-output operands
can have different modes, and in every other case except the PA one,
the mode of the output value determines the mode of the output reload
register.

If we want to continue to allow this, the fix is to change:

  if (rl->out && reg_rtx)

into:

  if (rl->out
      && reg_rtx
      && !(GET_CODE (rl->out) == SCRATCH && GET_MODE (rl->out) == VOIDmode))

in reload1.c.

What do you think?  Should pa.md be changed (probably along the same
lines as s390.md) or do you want to go with the reload change?

Richard


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35768


  parent reply	other threads:[~2008-03-31 16:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-30 17:28 [Bug middle-end/35768] New: " danglin at gcc dot gnu dot org
2008-03-30 23:59 ` [Bug middle-end/35768] " danglin at gcc dot gnu dot org
2008-03-31  0:03 ` danglin at gcc dot gnu dot org
2008-03-31 16:07 ` dave at hiauly1 dot hia dot nrc dot ca
2008-03-31 16:11 ` rsandifo at nildram dot co dot uk [this message]
2008-03-31 23:06 ` dave at hiauly1 dot hia dot nrc dot ca
2008-04-01  8:52 ` rsandifo at nildram dot co dot uk
2008-04-05 23:31 ` [Bug target/35768] " danglin at gcc dot gnu dot org
2008-04-10 22:52 ` danglin at gcc dot gnu dot org
2008-04-10 22:53 ` danglin at gcc dot gnu dot org

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=20080331161101.25070.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).