]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
calls.c: Include target.h.
authorRichard Henderson <rth@redhat.com>
Thu, 15 Aug 2002 00:07:55 +0000 (17:07 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 15 Aug 2002 00:07:55 +0000 (17:07 -0700)
        * calls.c: Include target.h.
        * Makefile.in (calls.o): Update.

        * config/alpha/alpha.c (alpha_end_function): Use targetm.binds_local_p.
        * config/alpha/alpha.h (FUNCTION_OK_FOR_SIBCALL): Likewise.

From-SVN: r56335

gcc/ChangeLog
gcc/Makefile.in
gcc/calls.c
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h

index eb1f21717e334f84188c717150f5e22d44a984c9..145f869ad16407a665bc83e2f9e7fd36405a576a 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-14  Richard Henderson  <rth@redhat.com>
+
+       * calls.c: Include target.h.
+       * Makefile.in (calls.o): Update.
+
+       * config/alpha/alpha.c (alpha_end_function): Use targetm.binds_local_p.
+       * config/alpha/alpha.h (FUNCTION_OK_FOR_SIBCALL): Likewise.
+
 2002-08-14  Richard Henderson  <rth@redhat.com>
 
        * Makefile.in (LOOSE_WARN): Add -fno-common.
index 798426d11be18d223f83c412dfd823d216bd9c5e..e7364954a607505485b9da88a45e66b58016a0e9 100644 (file)
@@ -1440,7 +1440,7 @@ builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
    $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
    except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h
 calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
-   $(EXPR_H) langhooks.h \
+   $(EXPR_H) langhooks.h $(TARGET_H) \
    libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
 expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h  \
    insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
index 144d7b1188b01b5fbd64f2f5c183597359b9f82c..5979747a68bdb7bf76b08358a1cdda6c90753e04 100644 (file)
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "timevar.h"
 #include "sbitmap.h"
 #include "langhooks.h"
+#include "target.h"
 
 #if !defined FUNCTION_OK_FOR_SIBCALL
 #define FUNCTION_OK_FOR_SIBCALL(DECL) 1
index 9b6f02669e5a04226bb20cef8a889e637503e3a6..99dee6bae6b20d0fbd5c0ee369174e29ea378962 100644 (file)
@@ -7736,7 +7736,7 @@ void
 alpha_end_function (file, fnname, decl)
      FILE *file;
      const char *fnname;
-     tree decl ATTRIBUTE_UNUSED;
+     tree decl;
 {
   /* End the function.  */
   if (!TARGET_ABI_UNICOSMK && !flag_inhibit_size_directive)
@@ -7747,20 +7747,16 @@ alpha_end_function (file, fnname, decl)
     }
   inside_function = FALSE;
 
-  /* Show that we know this function if it is called again. 
+  /* Show that we know this function if it is called again.
 
-     Don't do this for global functions in object files destined for a
-     shared library because the function may be overridden by the application
-     or other libraries.  Similarly, don't do this for weak functions.
+     Do this only for functions whose symbols bind locally.
 
      Don't do this for functions not defined in the .text section, as
      otherwise it's not unlikely that the destination is out of range
      for a direct branch.  */
 
-  if (!DECL_WEAK (current_function_decl)
-      && (!flag_pic || !TREE_PUBLIC (current_function_decl))
-      && decl_in_text_section (current_function_decl))
-    SYMBOL_REF_FLAG (XEXP (DECL_RTL (current_function_decl), 0)) = 1;
+  if ((*targetm.binds_local_p) (decl) && decl_in_text_section (decl))
+    SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
 
   /* Output jump tables and the static subroutine information block.  */
   if (TARGET_ABI_UNICOSMK)
index fa3294ae593e400fbf7a4c21b7fde982c604356b..d90d47618a7605b9e5573f14280f11bf49d789b8 100644 (file)
@@ -1158,12 +1158,11 @@ extern int alpha_memory_latency;
 
 /* We do not allow indirect calls to be optimized into sibling calls, nor
    can we allow a call to a function in a different compilation unit to
-   be optimized into a sibcall.  Except if the function is known not to
-   return, in which case our caller doesn't care what the gp is.  */
+   be optimized into a sibcall.  */
 #define FUNCTION_OK_FOR_SIBCALL(DECL)                  \
   (DECL                                                        \
-   && ((TREE_ASM_WRITTEN (DECL) && !flag_pic)          \
-       || ! TREE_PUBLIC (DECL)))
+   && (! TREE_PUBLIC (DECL)                            \
+       || (TREE_ASM_WRITTEN (DECL) && (*targetm.binds_local_p) (DECL))))
 
 /* Try to output insns to set TARGET equal to the constant C if it can be
    done in less than N insns.  Do all computations in MODE.  Returns the place