OSDN Git Service

* config/m68hc11/m68hc11.c (m68hc11_small_indexed_indirect_p): Look
authorciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Mar 2002 21:54:58 +0000 (21:54 +0000)
committerciceron <ciceron@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Mar 2002 21:54:58 +0000 (21:54 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50839 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68hc11/m68hc11.c
gcc/config/m68hc11/m68hc11.h

index 82f6aad..a3619d8 100644 (file)
@@ -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.
index e9b1bb9..bcaeae6 100644 (file)
@@ -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);
index 829e244..ee2a805 100644 (file)
@@ -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.  */