public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amylaar at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/27405] gcc.c-torture/execute/960209-1.c ICEs on sh64-* with -O3
Date: Mon, 08 May 2006 19:44:00 -0000	[thread overview]
Message-ID: <20060508194404.25473.qmail@sourceware.org> (raw)
In-Reply-To: <bug-27405-5208@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from amylaar at gcc dot gnu dot org  2006-05-08 19:44 -------
(In reply to comment #0)
> It seems that this move insn is generated at loop-invariant.c:
> move_invariant_reg().

Yes.  In general, we say that we don't want such SUBREGS to appear in the
first place, since then they could be propagated by the optimizers into
contexts where they don't belong.
However, that has already happened in this case.  THe subreg originally
appeared in:

(insn 183 204 184 17 (set (subreg:DI (reg:SI 205) 0)
        (gt:DI (reg/v:SI 169 [ q ])
            (reg:SI 210))) 14 {cmpgtsi_media} (nil)
    (nil))

In this context, the SUBREG is fine, because equality / inequality comparison
operators can generate only 0 or 1.  And tere is also a good reason to have
these operator always generate the same mode: this is required in order for
cse to function properly.

I don't think recognizing the move in insn 206 is the right way forward; the
subreg be further propagated into contexts where it does not belong.

Another approach would be to say that the loop invariant motion code should
have uses an SImode register, since the destination of the original instruction
was also ultimately an SIMode register.  However, that would mean that we
couldn't share the invariant with other uses where an DImode comparison result
is wanted.

The problem is that we loose information when we say that the result of the
comparison is DImode: we don't know any more that the value is suitable
for SImode without sign-extension.
On the other hand, if an SImode value is held in a general purpose register,
we know that we can use this register to get the sign-extended DImode value.

Thus, I think the right solution is to change the SHmedia setCC insns to
generate SImode values.  That will mean that for DImode there will initially be
ianother temporary register, and an extra sign extension insn.  We'll have
to check that SI->DI sign extensions can be folded into all the uses that
matter - arith_reg_operand already allows them, so where
that predicate is used (directly or indirectly), we should be fine.


-- 

amylaar at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-08 19:44:04
               date|                            |


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


  reply	other threads:[~2006-05-08 19:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-03  0:58 [Bug target/27405] New: " kkojima at gcc dot gnu dot org
2006-05-08 19:44 ` amylaar at gcc dot gnu dot org [this message]
2006-05-29 22:35 ` [Bug target/27405] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-06-04 18:46 ` mmitchel at gcc dot gnu dot org
2006-11-02 22:57 ` [Bug target/27405] [4.2/4.3 " kkojima at gcc dot gnu dot org
2006-11-05 20:36 ` patchapp at dberlin dot org
2006-11-30 19:45 ` chaoyingfu at gcc dot gnu dot org
2007-05-14 21:31 ` mmitchel at gcc dot gnu dot org
2007-05-20 23:14 ` kkojima at gcc dot gnu dot org
2007-05-21  0:01 ` kkojima 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=20060508194404.25473.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).