Commit 48f6efae by Nick Clifton Committed by Nick Clifton

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
parent e5ce1d6d
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> 2002-05-16 Neil Booth <neil@daikokuya.demon.co.uk>
* config/arc/arc.h (CPP_PREDEFINES): Remove. * config/arc/arc.h (CPP_PREDEFINES): Remove.
......
...@@ -2549,7 +2549,8 @@ arm_rtx_costs (x, code, outer) ...@@ -2549,7 +2549,8 @@ arm_rtx_costs (x, code, outer)
/* Memory costs quite a lot for the first word, but subsequent words /* Memory costs quite a lot for the first word, but subsequent words
load at the equivalent of a single insn each. */ load at the equivalent of a single insn each. */
return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) 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: case IF_THEN_ELSE:
/* XXX a guess. */ /* XXX a guess. */
...@@ -2597,7 +2598,8 @@ arm_rtx_costs (x, code, outer) ...@@ -2597,7 +2598,8 @@ arm_rtx_costs (x, code, outer)
/* Memory costs quite a lot for the first word, but subsequent words /* Memory costs quite a lot for the first word, but subsequent words
load at the equivalent of a single insn each. */ load at the equivalent of a single insn each. */
return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD) 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 DIV:
case MOD: case MOD:
...@@ -2905,16 +2907,16 @@ arm_adjust_cost (insn, link, dep, cost) ...@@ -2905,16 +2907,16 @@ arm_adjust_cost (insn, link, dep, cost)
&& (d_pat = single_set (dep)) != NULL && (d_pat = single_set (dep)) != NULL
&& GET_CODE (SET_DEST (d_pat)) == MEM) && 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 /* 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 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 constant pool are cached, and that others will miss. This is a
hack. */ hack. */
if (CONSTANT_POOL_ADDRESS_P (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, XEXP (SET_SRC (i_pat), 0)) || reg_mentioned_p (stack_pointer_rtx, src_mem)
|| reg_mentioned_p (frame_pointer_rtx, XEXP (SET_SRC (i_pat), 0)) || reg_mentioned_p (frame_pointer_rtx, src_mem)
|| reg_mentioned_p (hard_frame_pointer_rtx, || reg_mentioned_p (hard_frame_pointer_rtx, src_mem))
XEXP (SET_SRC (i_pat), 0)))
return 1; return 1;
} }
......
...@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_CPU_CPP_BUILTINS() \ #define TARGET_CPU_CPP_BUILTINS() \
do \ do \
{ \ { \
if (TARGET_THUMB) \ if (TARGET_ARM) \
builtin_define ("__arm__"); \ builtin_define ("__arm__"); \
else \ else \
builtin_define ("__thumb__"); \ builtin_define ("__thumb__"); \
...@@ -2134,7 +2134,8 @@ typedef struct ...@@ -2134,7 +2134,8 @@ typedef struct
goto WIN; \ goto WIN; \
/* This is PC relative data before MACHINE_DEPENDENT_REORG runs. */ \ /* This is PC relative data before MACHINE_DEPENDENT_REORG runs. */ \
else if (GET_MODE_SIZE (MODE) >= 4 && CONSTANT_P (X) \ 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; \ goto WIN; \
/* This is PC relative data after MACHINE_DEPENDENT_REORG runs. */ \ /* This is PC relative data after MACHINE_DEPENDENT_REORG runs. */ \
else if (GET_MODE_SIZE (MODE) >= 4 && reload_completed \ else if (GET_MODE_SIZE (MODE) >= 4 && reload_completed \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment