]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
linux64.h (ASM_OUTPUT_LABELREF): Remove.
authorJanis Johnson <janis187@us.ibm.com>
Wed, 30 Apr 2003 16:51:23 +0000 (16:51 +0000)
committerJanis Johnson <janis@gcc.gnu.org>
Wed, 30 Apr 2003 16:51:23 +0000 (16:51 +0000)
2003-04-30  Janis Johnson  <janis187@us.ibm.com>

* config/rs6000/linux64.h (ASM_OUTPUT_LABELREF): Remove.
* config/rs6000/rs6000.c (rs6000_elf_strip_name_encoding): Remove.
(rs6000_xcoff_encode_section_info): Remove.
(current_file_function_operand): Use SYMBOL_REF_FLAGS; fix latent bug.
(rs6000_output_mi_thunk): Remove dead code; use SYMBOL_REF_FLAGS.
(small_data_operand, rs6000_emit_move, rs6000_elf_in_small_data_p,):
Use SYMBOL_REF_FLAGS.
(rs6000_elf_encode_section_info): Call default_encode_section_info for
generic flags, use SYMBOL_REF_FLAGS; code cleanups.
* sysv4.h (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
(SYMBOL_FLAG_SMALL_V4, SYMBOL_REF_SMALL_V4_P): New.
* xcoff.h (TARGET_ENCODE_SECTION_INFO): Remove.
(ASM_DECLARE_FUNCTION_NAME): Remove setting of SYMBOL_REF_FLAG.

From-SVN: r66297

gcc/ChangeLog
gcc/config/rs6000/linux64.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/sysv4.h
gcc/config/rs6000/xcoff.h

index 46d899f2cefc70c09ba6768fce412b6fdc11b9d8..ba6abb7e29ef3b4888896546e1710a9ba9581144 100644 (file)
@@ -1,3 +1,19 @@
+2003-04-30  Janis Johnson  <janis187@us.ibm.com>
+
+       * config/rs6000/linux64.h (ASM_OUTPUT_LABELREF): Remove.
+       * config/rs6000/rs6000.c (rs6000_elf_strip_name_encoding): Remove.
+       (rs6000_xcoff_encode_section_info): Remove.
+       (current_file_function_operand): Use SYMBOL_REF_FLAGS; fix latent bug.
+       (rs6000_output_mi_thunk): Remove dead code; use SYMBOL_REF_FLAGS.
+       (small_data_operand, rs6000_emit_move, rs6000_elf_in_small_data_p,):
+       Use SYMBOL_REF_FLAGS.
+       (rs6000_elf_encode_section_info): Call default_encode_section_info for
+       generic flags, use SYMBOL_REF_FLAGS; code cleanups.
+       * sysv4.h (TARGET_STRIP_NAME_ENCODING, ASM_OUTPUT_LABELREF): Remove.
+       (SYMBOL_FLAG_SMALL_V4, SYMBOL_REF_SMALL_V4_P): New.
+       * xcoff.h (TARGET_ENCODE_SECTION_INFO): Remove.
+       (ASM_DECLARE_FUNCTION_NAME): Remove setting of SYMBOL_REF_FLAG.
+
 2003-04-30  Gabriel Dos Reis <gdr@integrable-solutions.net>
 
        * diagnostic.c (output_pointer): Use HOST_PTR_PRINTF.
index ee5a7006680881711823930d706748d8b85c6be5..0cc8ae0cbc32d8796c14306b2d6b5ebc8a1957eb 100644 (file)
 #undef  PREFERRED_DEBUGGING_TYPE
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
-/* This is how to output a reference to a user-level label named NAME.
-   `assemble_name' uses this.  */
-
-/* Override elfos.h definition.  */
-#undef  ASM_OUTPUT_LABELREF
-#define ASM_OUTPUT_LABELREF(FILE,NAME)         \
-do {                                           \
-  const char *_name = NAME;                    \
-  if (*_name == '@')                           \
-    _name++;                                   \
-                                               \
-  if (*_name == '*')                           \
-    fprintf (FILE, "%s", _name + 1);           \
-  else                                         \
-    asm_fprintf (FILE, "%U%s", _name);         \
-} while (0)
-
 #undef  ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                    \
   do                                                                   \
index 66e6e5205cf46b144fbb85a5eda05ddc00baa658..a2186cfe94f5fd38995acb0a1da3ab83701dff05 100644 (file)
@@ -231,7 +231,6 @@ static void rs6000_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
                                                   unsigned HOST_WIDE_INT));
 static void rs6000_elf_encode_section_info PARAMS ((tree, rtx, int))
      ATTRIBUTE_UNUSED;
-static const char *rs6000_elf_strip_name_encoding PARAMS ((const char *));
 static bool rs6000_elf_in_small_data_p PARAMS ((tree));
 #endif
 #if TARGET_XCOFF
@@ -244,8 +243,6 @@ static void rs6000_xcoff_select_rtx_section PARAMS ((enum machine_mode, rtx,
                                                     unsigned HOST_WIDE_INT));
 static const char * rs6000_xcoff_strip_name_encoding PARAMS ((const char *));
 static unsigned int rs6000_xcoff_section_type_flags PARAMS ((tree, const char *, int));
-static void rs6000_xcoff_encode_section_info PARAMS ((tree, rtx, int))
-     ATTRIBUTE_UNUSED;
 #endif
 #if TARGET_MACHO
 static bool rs6000_binds_local_p PARAMS ((tree));
@@ -2092,17 +2089,24 @@ call_operand (op, mode)
 }
 
 /* Return 1 if the operand is a SYMBOL_REF for a function known to be in
-   this file and the function is not weakly defined.  */
+   this file.  */
 
 int
 current_file_function_operand (op, mode)
      rtx op;
      enum machine_mode mode ATTRIBUTE_UNUSED;
 {
-  return (GET_CODE (op) == SYMBOL_REF
-         && (SYMBOL_REF_FLAG (op)
-             || (op == XEXP (DECL_RTL (current_function_decl), 0)
-                 && ! DECL_WEAK (current_function_decl))));
+  if (GET_CODE (op) == SYMBOL_REF
+      && (SYMBOL_REF_LOCAL_P (op)
+         || (op == XEXP (DECL_RTL (current_function_decl), 0))))
+    {
+#ifdef ENABLE_CHECKING
+      if (!SYMBOL_REF_FUNCTION_P (op))
+       abort ();
+#endif
+      return 1;
+    }
+  return 0;
 }
 
 /* Return 1 if this operand is a valid input for a move insn.  */
@@ -2206,11 +2210,7 @@ small_data_operand (op, mode)
       sym_ref = XEXP (sum, 0);
     }
 
-  if (*XSTR (sym_ref, 0) != '@')
-    return 0;
-
-  return 1;
-
+  return SYMBOL_REF_SMALL_V4_P (sym_ref);
 #else
   return 0;
 #endif
@@ -2939,8 +2939,9 @@ rs6000_emit_move (dest, source, mode)
              new_ref = gen_rtx_SYMBOL_REF (Pmode, name);
              CONSTANT_POOL_ADDRESS_P (new_ref)
                = CONSTANT_POOL_ADDRESS_P (operands[1]);
-             SYMBOL_REF_FLAG (new_ref) = SYMBOL_REF_FLAG (operands[1]);
+             SYMBOL_REF_FLAGS (new_ref) = SYMBOL_REF_FLAGS (operands[1]);
              SYMBOL_REF_USED (new_ref) = SYMBOL_REF_USED (operands[1]);
+             SYMBOL_REF_DECL (new_ref) = SYMBOL_REF_DECL (operands[1]);
              operands[1] = new_ref;
            }
 
@@ -11749,15 +11750,7 @@ rs6000_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
       TREE_USED (function) = 1;
     }
   funexp = XEXP (DECL_RTL (function), 0);
-
-  SYMBOL_REF_FLAG (funexp) = 0;
-  if (current_file_function_operand (funexp, VOIDmode)
-      && (! lookup_attribute ("longcall",
-                             TYPE_ATTRIBUTES (TREE_TYPE (function)))
-         || lookup_attribute ("shortcall",
-                              TYPE_ATTRIBUTES (TREE_TYPE (function)))))
-    SYMBOL_REF_FLAG (funexp) = 1;
-
+  SYMBOL_REF_FLAGS (funexp) &= ~SYMBOL_FLAG_LOCAL;
   funexp = gen_rtx_MEM (FUNCTION_MODE, funexp);
 
 #if TARGET_MACHO
@@ -12930,13 +12923,16 @@ rs6000_elf_unique_section (decl, reloc)
                            flag_pic || DEFAULT_ABI == ABI_AIX);
 }
 \f
-/* If we are referencing a function that is static or is known to be
-   in this file, make the SYMBOL_REF special.  We can use this to indicate
-   that we can branch to this function without emitting a no-op after the
-   call.  For real AIX calling sequences, we also replace the
-   function name with the real name (1 or 2 leading .'s), rather than
-   the function descriptor name.  This saves a lot of overriding code
-   to read the prefixes.  */
+/* For a SYMBOL_REF, set generic flags and then perform some
+   target-specific processing.
+
+   Set SYMBOL_FLAG_SMALL_V4 for an operand in small memory on V.4/eabi;
+   this is different from the generic SYMBOL_FLAG_SMALL.
+
+   When the AIX ABI is requested on a non-AIX system, replace the
+   function name with the real name (with a leading .) rather than the
+   function descriptor name.  This saves a lot of overriding code to
+   read the prefixes.  */
 
 static void
 rs6000_elf_encode_section_info (decl, rtl, first)
@@ -12944,26 +12940,19 @@ rs6000_elf_encode_section_info (decl, rtl, first)
      rtx rtl;
      int first;
 {
-  if (!first)
-    return;
+  default_encode_section_info (decl, rtl, first);
 
-  if (TREE_CODE (decl) == FUNCTION_DECL)
+  if (first
+      && TREE_CODE (decl) == FUNCTION_DECL
+      && !TARGET_AIX
+      && DEFAULT_ABI == ABI_AIX)
     {
       rtx sym_ref = XEXP (rtl, 0);
-      if ((*targetm.binds_local_p) (decl))
-       SYMBOL_REF_FLAG (sym_ref) = 1;
-
-      if (!TARGET_AIX && DEFAULT_ABI == ABI_AIX)
-       {
-         size_t len1 = (DEFAULT_ABI == ABI_AIX) ? 1 : 2;
-         size_t len2 = strlen (XSTR (sym_ref, 0));
-         char *str = alloca (len1 + len2 + 1);
-         str[0] = '.';
-         str[1] = '.';
-         memcpy (str + len1, XSTR (sym_ref, 0), len2 + 1);
-
-         XSTR (sym_ref, 0) = ggc_alloc_string (str, len1 + len2);
-       }
+      size_t len = strlen (XSTR (sym_ref, 0));
+      char *str = alloca (len + 2);
+      str[0] = '.';
+      memcpy (str + 1, XSTR (sym_ref, 0), len + 1);
+      XSTR (sym_ref, 0) = ggc_alloc_string (str, len + 1);
     }
   else if (rs6000_sdata != SDATA_NONE
           && DEFAULT_ABI == ABI_V4
@@ -12973,56 +12962,27 @@ rs6000_elf_encode_section_info (decl, rtl, first)
       int size = int_size_in_bytes (TREE_TYPE (decl));
       tree section_name = DECL_SECTION_NAME (decl);
       const char *name = (char *)0;
-      int len = 0;
-
-      if ((*targetm.binds_local_p) (decl))
-       SYMBOL_REF_FLAG (sym_ref) = 1;
 
       if (section_name)
        {
          if (TREE_CODE (section_name) == STRING_CST)
-           {
-             name = TREE_STRING_POINTER (section_name);
-             len = TREE_STRING_LENGTH (section_name);
-           }
+           name = TREE_STRING_POINTER (section_name);
          else
            abort ();
        }
 
       if (name
-         ? ((len == sizeof (".sdata") - 1
-             && strcmp (name, ".sdata") == 0)
-            || (len == sizeof (".sdata2") - 1
-                && strcmp (name, ".sdata2") == 0)
-            || (len == sizeof (".sbss") - 1
-                && strcmp (name, ".sbss") == 0)
-            || (len == sizeof (".sbss2") - 1
-                && strcmp (name, ".sbss2") == 0)
-            || (len == sizeof (".PPC.EMB.sdata0") - 1
-                && strcmp (name, ".PPC.EMB.sdata0") == 0)
-            || (len == sizeof (".PPC.EMB.sbss0") - 1
-                && strcmp (name, ".PPC.EMB.sbss0") == 0))
+         ? (strcmp (name, ".sdata") == 0
+            || strcmp (name, ".sdata2") == 0
+            || strcmp (name, ".sbss") == 0
+            || strcmp (name, ".sbss2") == 0
+            || strcmp (name, ".PPC.EMB.sdata0") == 0
+            || strcmp (name, ".PPC.EMB.sbss0") == 0)
          : (size > 0 && size <= g_switch_value))
-       {
-         size_t len = strlen (XSTR (sym_ref, 0));
-         char *str = alloca (len + 2);
-
-         str[0] = '@';
-         memcpy (str + 1, XSTR (sym_ref, 0), len + 1);
-         XSTR (sym_ref, 0) = ggc_alloc_string (str, len + 1);
-       }
+       SYMBOL_REF_FLAGS (sym_ref) |= SYMBOL_FLAG_SMALL_V4;
     }
 }
 
-static const char *
-rs6000_elf_strip_name_encoding (str)
-     const char *str;
-{
-  while (*str == '*' || *str == '@')
-    str++;
-  return str;
-}
-
 static bool
 rs6000_elf_in_small_data_p (decl)
      tree decl;
@@ -13631,17 +13591,6 @@ rs6000_xcoff_section_type_flags (decl, name, reloc)
 
   return flags | (exact_log2 (align) & SECTION_ENTSIZE);
 }
-
-static void
-rs6000_xcoff_encode_section_info (decl, rtl, first)
-     tree decl;
-     rtx rtl;
-     int first ATTRIBUTE_UNUSED;
-{
-  if (TREE_CODE (decl) == FUNCTION_DECL
-      && (*targetm.binds_local_p) (decl))
-    SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
-}
 #endif /* TARGET_XCOFF */
 
 #if TARGET_MACHO
index 3e7d711942eb59020dcefd614f766795aeae22cc..8fd4f45a3209d3844ca9a155ea779431ac8aeaaa 100644 (file)
@@ -766,7 +766,6 @@ extern int fixuplabelno;
 #define DBX_DEBUGGING_INFO 1
 
 #define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
-#define TARGET_STRIP_NAME_ENCODING  rs6000_elf_strip_name_encoding
 #define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
 #define TARGET_SECTION_TYPE_FLAGS  rs6000_elf_section_type_flags
 
@@ -775,25 +774,8 @@ extern int fixuplabelno;
 #define        RS6000_OUTPUT_BASENAME(FILE, NAME)      \
     assemble_name (FILE, NAME)
 
-/* This is how to output a reference to a user-level label named NAME.
-   `assemble_name' uses this.  */
-
-/* Override elfos.h definition.  */
-#undef ASM_OUTPUT_LABELREF
-#define        ASM_OUTPUT_LABELREF(FILE,NAME)          \
-do {                                           \
-  const char *_name = NAME;                    \
-  if (*_name == '@')                           \
-    _name++;                                   \
-                                               \
-  if (*_name == '*')                           \
-    fprintf (FILE, "%s", _name + 1);           \
-  else                                         \
-    asm_fprintf (FILE, "%U%s", _name);         \
-} while (0)
-
-/* But, to make this work, we have to output the stabs for the function
-   name *first*...  */
+/* We have to output the stabs for the function name *first*, before
+   outputting its label.  */
 
 #define        DBX_FUNCTION_FIRST
 
@@ -1392,3 +1374,9 @@ ncrtn.o%s"
 
 /* Generate entries in .fixup for relocatable addresses.  */
 #define RELOCATABLE_NEEDS_FIXUP
+
+/* Define target-specific symbol_ref flags, beginning with
+   SYMBOL_REF_FLAG_DEP.  */
+#define SYMBOL_FLAG_SMALL_V4  (SYMBOL_FLAG_MACH_DEP << 0)
+#define SYMBOL_REF_SMALL_V4_P(RTX) \
+  ((SYMBOL_REF_FLAGS (RTX) & SYMBOL_FLAG_SMALL_V4) != 0)
index 56dce7ea21d0226989b8b1b2b75100c7cd090b39..fe65ea93c21145d2e596444b80a0ff8132ed0751 100644 (file)
@@ -163,7 +163,6 @@ toc_section ()                                              \
 #define TARGET_ASM_SELECT_SECTION  rs6000_xcoff_select_section
 #define TARGET_ASM_SELECT_RTX_SECTION  rs6000_xcoff_select_rtx_section
 #define TARGET_ASM_UNIQUE_SECTION  rs6000_xcoff_unique_section
-#define TARGET_ENCODE_SECTION_INFO  rs6000_xcoff_encode_section_info
 #define TARGET_STRIP_NAME_ENCODING  rs6000_xcoff_strip_name_encoding
 #define TARGET_SECTION_TYPE_FLAGS  rs6000_xcoff_section_type_flags
 
@@ -255,16 +254,11 @@ toc_section ()                                            \
    `text_section' call previously done.  We do have to go back to that
    csect, however.
 
-   We also record that the function exists in the current compilation
-   unit, reachable by short branch, by setting SYMBOL_REF_FLAG.
-
    The third and fourth parameters to the .function pseudo-op (16 and 044)
    are placeholders which no longer have any use.  */
 
 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL)              \
 { rtx sym_ref = XEXP (DECL_RTL (DECL), 0);                     \
-  if ((*targetm.binds_local_p) (DECL))                         \
-    SYMBOL_REF_FLAG (sym_ref) = 1;                             \
   if (TREE_PUBLIC (DECL))                                      \
     {                                                          \
       if (!RS6000_WEAK || !DECL_WEAK (decl))                   \