This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Accept 16-bit constants as valid MEM for 68HC12
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jun 2002 23:59:56 +0200
- Subject: [PATCH]: Accept 16-bit constants as valid MEM for 68HC12
Hi!
I've committed the following patch to fix 68HC12 memory addressing mode.
An integral constant address (16 bit) is legal MEM and was rejected.
Committed on main and 3_1.
Stephane
2002-06-28 Stephane Carrez <Stephane.Carrez@nerim.fr>
* config/m68hc11/m68hc11.c (register_indirect_p): For 68HC12 a constant
can be a valid address.
Index: config/m68hc11/m68hc11.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.c,v
retrieving revision 1.43
diff -u -p -r1.43 m68hc11.c
--- config/m68hc11/m68hc11.c 4 Jun 2002 07:09:09 -0000 1.43
+++ config/m68hc11/m68hc11.c 28 Jun 2002 19:50:13 -0000
@@ -1,6 +1,6 @@
/* Subroutines for code generation on Motorola 68HC11 and 68HC12.
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Contributed by Stephane Carrez (stcarrez@worldnet.fr)
+ Contributed by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GNU CC.
@@ -549,6 +549,12 @@ register_indirect_p (operand, mode, stri
case REG:
return REGNO_OK_FOR_BASE_P2 (REGNO (operand), strict);
+
+ case CONST_INT:
+ if (TARGET_M6811)
+ return 0;
+
+ return VALID_CONSTANT_OFFSET_P (operand, mode);
default:
return 0;