aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/m68hc11/m68hc11.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 31cafc8..af21040 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-02 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Fix when
+ comparing with Z register.
+
2004-03-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* cfgloop.h (struct loop_desc): Removed.
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index e5bca2e..a0e83c3 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -4169,8 +4169,10 @@ m68hc11_check_z_replacement (rtx insn, struct replace_info *info)
{
if ((GET_CODE (src) == REG && REGNO (src) == HARD_Z_REGNUM)
|| (GET_CODE (src) == COMPARE &&
- (rtx_equal_p (XEXP (src, 0), z_reg)
- || rtx_equal_p (XEXP (src, 1), z_reg))))
+ ((rtx_equal_p (XEXP (src, 0), z_reg)
+ && H_REG_P (XEXP (src, 1)))
+ || (rtx_equal_p (XEXP (src, 1), z_reg)
+ && H_REG_P (XEXP (src, 0))))))
{
if (insn == info->first)
{