aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Blundell <pb@nexus.co.uk>2002-02-19 18:04:05 +0000
committerPhil Blundell <pb@gcc.gnu.org>2002-02-19 18:04:05 +0000
commit14f583b8c3465efa654af1233e9c63365cd41cc9 (patch)
tree5584cd64a9c88885dad300c267774a043e3d066f /gcc
parent4cb7482c3ae0a089a988a648c562e0c7f2ecbe98 (diff)
downloadgcc-14f583b8c3465efa654af1233e9c63365cd41cc9.zip
gcc-14f583b8c3465efa654af1233e9c63365cd41cc9.tar.gz
gcc-14f583b8c3465efa654af1233e9c63365cd41cc9.tar.bz2
arm.c (arm_encode_call_attribute): Operate on any decl, not just FUNCTION_DECL.
2002-02-19 Philip Blundell <pb@nexus.co.uk> * 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/arm/arm.c12
-rw-r--r--gcc/config/arm/arm.h4
3 files changed, 18 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b87e206..c5413d9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2002-02-19 Philip Blundell <pb@nexus.co.uk>
+
+ * 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 <mrg@eterna.com.au>
* config.gcc (sparc-*-netbsdelf*): Enable target.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 9ef81bf..4482c1b 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 9b60d7b..bd448db 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); \