From 14f583b8c3465efa654af1233e9c63365cd41cc9 Mon Sep 17 00:00:00 2001 From: Philip Blundell Date: Tue, 19 Feb 2002 18:04:05 +0000 Subject: [PATCH] arm.c (arm_encode_call_attribute): Operate on any decl, not just FUNCTION_DECL. 2002-02-19 Philip Blundell * config/arm/arm.c (arm_encode_call_attribute): Operate on any decl, not just FUNCTION_DECL. (legitimize_pic_address): Handle local SYMBOL_REF like LABEL_REF. (arm_assemble_integer): Likewise. * config/arm/arm.h (ARM_ENCODE_CALL_TYPE): Allow any decl to be marked local. From-SVN: r49871 --- gcc/ChangeLog | 9 +++++++++ gcc/config/arm/arm.c | 12 +++++++----- gcc/config/arm/arm.h | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b87e206abd3..c5413d975cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-02-19 Philip Blundell + + * config/arm/arm.c (arm_encode_call_attribute): Operate on any + decl, not just FUNCTION_DECL. + (legitimize_pic_address): Handle local SYMBOL_REF like LABEL_REF. + (arm_assemble_integer): Likewise. + * config/arm/arm.h (ARM_ENCODE_CALL_TYPE): Allow any decl to be + marked local. + 2002-02-19 matthew green * config.gcc (sparc-*-netbsdelf*): Enable target. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9ef81bf0478..4482c1b2331 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2099,9 +2099,6 @@ arm_encode_call_attribute (decl, flag) int len = strlen (str); char * newstr; - if (TREE_CODE (decl) != FUNCTION_DECL) - return; - /* Do not allow weak functions to be treated as short call. */ if (DECL_WEAK (decl) && flag == SHORT_CALL_FLAG_CHAR) return; @@ -2315,7 +2312,10 @@ legitimize_pic_address (orig, mode, reg) else emit_insn (gen_pic_load_addr_thumb (address, orig)); - if (GET_CODE (orig) == LABEL_REF && NEED_GOT_RELOC) + if ((GET_CODE (orig) == LABEL_REF + || (GET_CODE (orig) == SYMBOL_REF && + ENCODED_SHORT_CALL_ATTR_P (XSTR (orig, 0)))) + && NEED_GOT_RELOC) pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address); else { @@ -8599,7 +8599,9 @@ arm_assemble_integer (x, size, aligned_p) if (NEED_GOT_RELOC && flag_pic && making_const_table && (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)) { - if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) + if (GET_CODE (x) == SYMBOL_REF + && (CONSTANT_POOL_ADDRESS_P (x) + || ENCODED_SHORT_CALL_ATTR_P (XSTR (x, 0)))) fputs ("(GOTOFF)", asm_out_file); else if (GET_CODE (x) == LABEL_REF) fputs ("(GOTOFF)", asm_out_file); diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 9b60d7bda59..bd448dbe4e2 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1891,9 +1891,9 @@ typedef struct or known to be defined in this file then encode a short call flag. This macro is used inside the ENCODE_SECTION macro. */ #define ARM_ENCODE_CALL_TYPE(decl) \ - if (TREE_CODE (decl) == FUNCTION_DECL) \ + if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd') \ { \ - if (DECL_WEAK (decl)) \ + if (TREE_CODE (decl) == FUNCTION_DECL && DECL_WEAK (decl)) \ arm_encode_call_attribute (decl, LONG_CALL_FLAG_CHAR); \ else if (! TREE_PUBLIC (decl)) \ arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR); \ -- 2.30.2