arm.c (arm_rtx_costs): Check for RTX being a SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P.

* config/arm/arm.c (arm_rtx_costs): Check for RTX being a
    SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P.
    (arm_adjust_cost): Check for RTX being a SYMBOL_REF before
    calling CONSTANT_POOL_ADDRESS_P.
    * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Fix typo in code
    to decide whether to define __arm__ or __thumb.
        (THUMB_GO_IF_LEGITIMATE_ADDRESS): Check for RTX being a
    SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P.

From-SVN: r53519
This commit is contained in:
Nick Clifton 2002-05-16 15:17:41 +00:00 committed by Nick Clifton
parent e5ce1d6de7
commit 48f6efae63
3 changed files with 23 additions and 9 deletions

View File

@ -1,3 +1,14 @@
2002-05-16 Nick Clifton <nickc@cambridge.redhat.com>
* config/arm/arm.c (arm_rtx_costs): Check for RTX being a
SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P.
(arm_adjust_cost): Check for RTX being a SYMBOL_REF before
calling CONSTANT_POOL_ADDRESS_P.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Fix typo in code
to decide whether to define __arm__ or __thumb.
(THUMB_GO_IF_LEGITIMATE_ADDRESS): Check for RTX being a
SYMBOL_REF before calling CONSTANT_POOL_ADDRESS_P.
2002-05-16 Neil Booth <neil@daikokuya.demon.co.uk>
* config/arc/arc.h (CPP_PREDEFINES): Remove.

View File

@ -2549,7 +2549,8 @@ arm_rtx_costs (x, code, outer)
/* Memory costs quite a lot for the first word, but subsequent words
load at the equivalent of a single insn each. */
return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
+ (CONSTANT_POOL_ADDRESS_P (x) ? 4 : 0));
+ ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
? 4 : 0));
case IF_THEN_ELSE:
/* XXX a guess. */
@ -2597,7 +2598,8 @@ arm_rtx_costs (x, code, outer)
/* Memory costs quite a lot for the first word, but subsequent words
load at the equivalent of a single insn each. */
return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
+ (CONSTANT_POOL_ADDRESS_P (x) ? 4 : 0));
+ (GET_CODE (x) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (x) ? 4 : 0));
case DIV:
case MOD:
@ -2905,16 +2907,16 @@ arm_adjust_cost (insn, link, dep, cost)
&& (d_pat = single_set (dep)) != NULL
&& GET_CODE (SET_DEST (d_pat)) == MEM)
{
rtx src_mem = XEXP (SET_SRC (i_pat), 0);
/* This is a load after a store, there is no conflict if the load reads
from a cached area. Assume that loads from the stack, and from the
constant pool are cached, and that others will miss. This is a
hack. */
if (CONSTANT_POOL_ADDRESS_P (XEXP (SET_SRC (i_pat), 0))
|| reg_mentioned_p (stack_pointer_rtx, XEXP (SET_SRC (i_pat), 0))
|| reg_mentioned_p (frame_pointer_rtx, XEXP (SET_SRC (i_pat), 0))
|| reg_mentioned_p (hard_frame_pointer_rtx,
XEXP (SET_SRC (i_pat), 0)))
if ((GET_CODE (src_mem) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (src_mem))
|| reg_mentioned_p (stack_pointer_rtx, src_mem)
|| reg_mentioned_p (frame_pointer_rtx, src_mem)
|| reg_mentioned_p (hard_frame_pointer_rtx, src_mem))
return 1;
}

View File

@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
if (TARGET_THUMB) \
if (TARGET_ARM) \
builtin_define ("__arm__"); \
else \
builtin_define ("__thumb__"); \
@ -2134,7 +2134,8 @@ typedef struct
goto WIN; \
/* This is PC relative data before MACHINE_DEPENDENT_REORG runs. */ \
else if (GET_MODE_SIZE (MODE) >= 4 && CONSTANT_P (X) \
&& CONSTANT_POOL_ADDRESS_P (X) && ! flag_pic) \
&& GET_CODE (X) == SYMBOL_REF \
&& CONSTANT_POOL_ADDRESS_P (X) && ! flag_pic) \
goto WIN; \
/* This is PC relative data after MACHINE_DEPENDENT_REORG runs. */ \
else if (GET_MODE_SIZE (MODE) >= 4 && reload_completed \