aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@cambridge.redhat.com>2002-05-16 15:17:41 +0000
committerNick Clifton <nickc@gcc.gnu.org>2002-05-16 15:17:41 +0000
commit48f6efae63cc3e9a8c8ab48bcbe2677256ac55d5 (patch)
treef53fc58ecadaac2573de254c444e2a7377fd175d
parente5ce1d6de713d82c5296916a10c9cb3b41ecd0a8 (diff)
downloadgcc-48f6efae63cc3e9a8c8ab48bcbe2677256ac55d5.zip
gcc-48f6efae63cc3e9a8c8ab48bcbe2677256ac55d5.tar.gz
gcc-48f6efae63cc3e9a8c8ab48bcbe2677256ac55d5.tar.bz2
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
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/arm/arm.c16
-rw-r--r--gcc/config/arm/arm.h5
3 files changed, 23 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bf23d0f..38654fb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index ba5eb05..a1543f8 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -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;
}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index b5a848a..fcb2c1f 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -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 \