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.
{
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;
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
{
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;
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))
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);
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. */