From 3ccc58a6ebc96ac94707c335826ed094c0e54a4c Mon Sep 17 00:00:00 2001 From: nickc Date: Thu, 16 May 2002 15:17:41 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53519 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/arm/arm.c | 16 +++++++++------- gcc/config/arm/arm.h | 5 +++-- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf23d0fe43f..38654fbbbe0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2002-05-16 Nick Clifton + + * 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 * config/arc/arc.h (CPP_PREDEFINES): Remove. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index ba5eb055e67..a1543f88533 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 b5a848aae13..fcb2c1f4a67 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 \ -- 2.11.4.GIT