This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix hard_reg_operand HC11 predicate
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 31 Mar 2003 23:05:36 +0200
- Subject: [PATCH]: Fix hard_reg_operand HC11 predicate
Hi!
I committed on 3_3 and mainline the following patch to add the missing check
about the mode in hard_reg_operand predicate. It didn't bless in insn recognitions
as the mode is also checked (and correctly) on other operands or operation.
But since this predicate is now used by peephole2 patterns, it results in wrong
recognitions.
Stephane
2003-03-31 Stephane Carrez <stcarrez at nerim dot fr>
* config/m68hc11/m68hc11.c (hard_reg_operand): Check the mode.
Index: config/m68hc11/m68hc11.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.c,v
retrieving revision 1.56.4.14
diff -u -p -r1.56.4.14 m68hc11.c
--- config/m68hc11/m68hc11.c 31 Mar 2003 20:40:22 -0000 1.56.4.14
+++ config/m68hc11/m68hc11.c 31 Mar 2003 20:52:49 -0000
@@ -1042,8 +1042,11 @@ hard_addr_reg_operand (operand, mode)
int
hard_reg_operand (operand, mode)
rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ enum machine_mode mode;
{
+ if (GET_MODE (operand) != mode && mode != VOIDmode)
+ return 0;
+
if (GET_CODE (operand) == SUBREG)
operand = XEXP (operand, 0);