aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStephane Carrez <Stephane.Carrez@worldnet.fr>2002-03-15 22:54:58 +0100
committerStephane Carrez <ciceron@gcc.gnu.org>2002-03-15 22:54:58 +0100
commitfdffea1abb5dca21db50ad6e5c36ba3dfb301f7e (patch)
tree3cb8c1eb2e01fed535dc48f0e6142f2aaaee1a3d /gcc
parent6272bc6859f211cf4cc9b8b02f56a87a0c381834 (diff)
downloadgcc-fdffea1abb5dca21db50ad6e5c36ba3dfb301f7e.zip
gcc-fdffea1abb5dca21db50ad6e5c36ba3dfb301f7e.tar.gz
gcc-fdffea1abb5dca21db50ad6e5c36ba3dfb301f7e.tar.bz2
m68hc11.c (m68hc11_small_indexed_indirect_p): Look for reg_equiv_memory_loc when the operand is a register that does not get...
* config/m68hc11/m68hc11.c (m68hc11_small_indexed_indirect_p): Look for reg_equiv_memory_loc when the operand is a register that does not get a hard register (stack location). (tst_operand): After reload, accept all memory operand. (symbolic_memory_operand): Fix detection of symbolic references. * config/m68hc11/m68hc11.h (VALID_CONSTANT_OFFSET_P): For 68HC12 accept symbols and any constant. From-SVN: r50839
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/m68hc11/m68hc11.c20
-rw-r--r--gcc/config/m68hc11/m68hc11.h12
3 files changed, 35 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 82f6aad..a3619d8c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
2002-03-15 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+ * config/m68hc11/m68hc11.c (m68hc11_small_indexed_indirect_p): Look
+ for reg_equiv_memory_loc when the operand is a register that does
+ not get a hard register (stack location).
+ (tst_operand): After reload, accept all memory operand.
+ (symbolic_memory_operand): Fix detection of symbolic references.
+ * config/m68hc11/m68hc11.h (VALID_CONSTANT_OFFSET_P): For 68HC12
+ accept symbols and any constant.
+
+2002-03-15 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
* config/m68hc11/m68hc11.c (emit_move_after_reload): Add a REG_INC
note on the insn that sets the soft frame register.
(must_parenthesize): ix and iy are also reserved names.
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index e9b1bb9..bcaeae6 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -551,6 +551,14 @@ m68hc11_small_indexed_indirect_p (operand, mode)
{
rtx base, offset;
+ if (GET_CODE (operand) == REG && reload_in_progress
+ && REGNO (operand) >= FIRST_PSEUDO_REGISTER
+ && reg_equiv_memory_loc[REGNO (operand)])
+ {
+ operand = reg_equiv_memory_loc[REGNO (operand)];
+ operand = eliminate_regs (operand, 0, NULL_RTX);
+ }
+
if (GET_CODE (operand) != MEM)
return 0;
@@ -561,8 +569,7 @@ m68hc11_small_indexed_indirect_p (operand, mode)
if (PUSH_POP_ADDRESS_P (operand))
return 1;
- if (!register_indirect_p (operand, mode,
- (reload_completed | reload_in_progress)))
+ if (!register_indirect_p (operand, mode, reload_completed))
return 0;
if (TARGET_M6812 && GET_CODE (operand) == PLUS
@@ -570,6 +577,12 @@ m68hc11_small_indexed_indirect_p (operand, mode)
{
base = XEXP (operand, 0);
offset = XEXP (operand, 1);
+
+ /* The offset can be a symbol address and this is too big
+ for the operand constraint. */
+ if (GET_CODE (base) != CONST_INT && GET_CODE (offset) != CONST_INT)
+ return 0;
+
if (GET_CODE (base) == CONST_INT)
offset = base;
@@ -853,7 +866,7 @@ tst_operand (operand, mode)
rtx operand;
enum machine_mode mode;
{
- if (GET_CODE (operand) == MEM)
+ if (GET_CODE (operand) == MEM && reload_completed == 0)
{
rtx addr = XEXP (operand, 0);
if (m68hc11_auto_inc_p (addr))
@@ -1010,6 +1023,7 @@ symbolic_memory_operand (op, mode)
return 1;
case CONST:
+ op = XEXP (op, 0);
return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF
|| GET_CODE (XEXP (op, 0)) == LABEL_REF)
&& GET_CODE (XEXP (op, 1)) == CONST_INT);
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 829e244..ee2a805 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1275,10 +1275,14 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
a mode offset to access the lowest part of the data.
(For example, for an SImode, the last valid offset is 252.) */
#define VALID_CONSTANT_OFFSET_P(X,MODE) \
-((GET_CODE (X) == CONST_INT) && \
- ((INTVAL (X) >= VALID_MIN_OFFSET) \
- && ((INTVAL (X) <= VALID_MAX_OFFSET \
- - (HOST_WIDE_INT) (GET_MODE_SIZE (MODE) + 1)))))
+(((GET_CODE (X) == CONST_INT) && \
+ ((INTVAL (X) >= VALID_MIN_OFFSET) \
+ && ((INTVAL (X) <= VALID_MAX_OFFSET \
+ - (HOST_WIDE_INT) (GET_MODE_SIZE (MODE) + 1))))) \
+|| (TARGET_M6812 \
+ && ((GET_CODE (X) == SYMBOL_REF) \
+ || GET_CODE (X) == LABEL_REF \
+ || GET_CODE (X) == CONST)))
/* This is included to allow stack push/pop operations. Special hacks in the
md and m6811.c files exist to support this. */