OSDN Git Service

2002-02-19 Philip Blundell <pb@nexus.co.uk>
authorpb <pb@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Feb 2002 18:04:05 +0000 (18:04 +0000)
committerpb <pb@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Feb 2002 18:04:05 +0000 (18:04 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49871 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h

index b87e206..c5413d9 100644 (file)
@@ -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.
index 9ef81bf..4482c1b 100644 (file)
@@ -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);
index 9b60d7b..bd448db 100644 (file)
@@ -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);                \