aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/alpha
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-08-14 17:07:55 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-08-14 17:07:55 -0700
commit236261548b57ca45c29735e29708976525ddb9a5 (patch)
tree1176bf68bd1ec4d7fe79eeb49abf9b39ed4a4b47 /gcc/config/alpha
parentfd350d241fecf6ce538c72978ba4483e6a8fb549 (diff)
downloadgcc-236261548b57ca45c29735e29708976525ddb9a5.zip
gcc-236261548b57ca45c29735e29708976525ddb9a5.tar.gz
gcc-236261548b57ca45c29735e29708976525ddb9a5.tar.bz2
calls.c: Include target.h.
* 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
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r--gcc/config/alpha/alpha.c14
-rw-r--r--gcc/config/alpha/alpha.h7
2 files changed, 8 insertions, 13 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 9b6f026..99dee6b 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -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)
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index fa3294a..d90d476 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -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