Commit 14f583b8 by Philip Blundell Committed by Phil Blundell

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
parent 4cb7482c
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> 2002-02-19 matthew green <mrg@eterna.com.au>
* config.gcc (sparc-*-netbsdelf*): Enable target. * config.gcc (sparc-*-netbsdelf*): Enable target.
......
...@@ -2099,9 +2099,6 @@ arm_encode_call_attribute (decl, flag) ...@@ -2099,9 +2099,6 @@ arm_encode_call_attribute (decl, flag)
int len = strlen (str); int len = strlen (str);
char * newstr; char * newstr;
if (TREE_CODE (decl) != FUNCTION_DECL)
return;
/* Do not allow weak functions to be treated as short call. */ /* Do not allow weak functions to be treated as short call. */
if (DECL_WEAK (decl) && flag == SHORT_CALL_FLAG_CHAR) if (DECL_WEAK (decl) && flag == SHORT_CALL_FLAG_CHAR)
return; return;
...@@ -2315,7 +2312,10 @@ legitimize_pic_address (orig, mode, reg) ...@@ -2315,7 +2312,10 @@ legitimize_pic_address (orig, mode, reg)
else else
emit_insn (gen_pic_load_addr_thumb (address, orig)); 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); pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, address);
else else
{ {
...@@ -8599,7 +8599,9 @@ arm_assemble_integer (x, size, aligned_p) ...@@ -8599,7 +8599,9 @@ arm_assemble_integer (x, size, aligned_p)
if (NEED_GOT_RELOC && flag_pic && making_const_table && if (NEED_GOT_RELOC && flag_pic && making_const_table &&
(GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)) (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); fputs ("(GOTOFF)", asm_out_file);
else if (GET_CODE (x) == LABEL_REF) else if (GET_CODE (x) == LABEL_REF)
fputs ("(GOTOFF)", asm_out_file); fputs ("(GOTOFF)", asm_out_file);
......
...@@ -1891,9 +1891,9 @@ typedef struct ...@@ -1891,9 +1891,9 @@ typedef struct
or known to be defined in this file then encode a short call flag. or known to be defined in this file then encode a short call flag.
This macro is used inside the ENCODE_SECTION macro. */ This macro is used inside the ENCODE_SECTION macro. */
#define ARM_ENCODE_CALL_TYPE(decl) \ #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); \ arm_encode_call_attribute (decl, LONG_CALL_FLAG_CHAR); \
else if (! TREE_PUBLIC (decl)) \ else if (! TREE_PUBLIC (decl)) \
arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR); \ arm_encode_call_attribute (decl, SHORT_CALL_FLAG_CHAR); \
......
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