More bug fixes from Richard Earnshaw:

* Fix problems with moving constants smaller than the word size.
* Fix problems with CSE trying to shortcut PIC references.
This commit is contained in:
mycroft 1998-12-03 16:05:47 +00:00
parent dedf21f286
commit 3934bd1d8b
2 changed files with 11 additions and 4 deletions

View File

@ -3466,7 +3466,7 @@ add_constant (x, mode, address_only)
HOST_WIDE_INT offset;
*address_only = 0;
if (mode == SImode && GET_CODE (x) == MEM && CONSTANT_P (XEXP (x, 0))
if (GET_CODE (x) == MEM && CONSTANT_P (XEXP (x, 0))
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
x = get_pool_constant (XEXP (x, 0));
else if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P(x))
@ -3578,7 +3578,7 @@ fixit (src, mode, destreg)
return 1;
#endif
else
return (mode == SImode && GET_CODE (src) == MEM
return (GET_CODE (src) == MEM
&& GET_CODE (XEXP (src, 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (src, 0)));
}

View File

@ -1474,7 +1474,9 @@ do \
} */ \
else if (GET_MODE_CLASS (MODE) != MODE_FLOAT \
&& GET_CODE (X) == SYMBOL_REF \
&& CONSTANT_POOL_ADDRESS_P (X)) \
&& CONSTANT_POOL_ADDRESS_P (X) \
&& ! (flag_pic \
&& symbol_mentioned_p (get_pool_constant (X)))) \
goto LABEL; \
else if ((GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_DEC) \
&& (GET_MODE_SIZE (MODE) <= 4) \
@ -1727,7 +1729,12 @@ extern int arm_pic_register;
#define FINALIZE_PIC arm_finalize_pic ()
#define LEGITIMATE_PIC_OPERAND_P(X) (! symbol_mentioned_p (X))
/* We can't directly access anything that contains a symbol, nor can
we indirect via the constant pool */
#define LEGITIMATE_PIC_OPERAND_P(X) \
(! symbol_mentioned_p (X) \
&& (! CONSTANT_POOL_ADDRESS_P (X) \
|| ! symbol_mentioned_p (get_pool_constant (X))))