This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] sh target: bogus operand reference
- From: Samuel Tardieu <sam at rfc1149 dot net>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Alexandre Oliva <aoliva at redhat dot com>, Kaz Kojima <kkojima at gcc dot gnu dot org>
- Date: Sat, 1 Dec 2007 20:43:23 +0100
- Subject: [PATCH] sh target: bogus operand reference
- Organisation: RFC1149 (see http://www.rfc1149.net/)
cmpgeusi_t splitting code compares operand 0 to 0, while this constant
value can only be in operand 1. When compiling the Ada runtime, this leads
to a "cmp/hs #0,r7" instruction which is not valid as "cmp/hs" operands must
be two registers.
This is a regression from 4.2 as the optimization this patch fixes is not
present in the 4.2 branch.
gcc/
* config/sh/sh.md (cmpgeusi_t): Immediate operand is operand 1,
not 0.
Compilation regression tested on a cross-compiler from i686-linux to
sh4-linux.
Ok for trunk?
---
gcc/config/sh/sh.md | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 00221cc..d7e2727 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -648,7 +648,7 @@
(match_operand:SI 1 "arith_reg_or_0_operand" "rN")))]
"TARGET_SH1"
"cmp/hs %1,%0"
- "&& operands[0] == CONST0_RTX (SImode)"
+ "&& operands[1] == CONST0_RTX (SImode)"
[(pc)]
"
{
--
1.5.3.6