This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH turning FUNCTION_OK_FOR_SIBCALL into target hook
- From: Andreas Bauer <baueran at in dot tum dot de>
- To: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, pizka at informatik dot tu-muenchen dot de
- Date: Thu, 3 Oct 2002 16:55:00 +1000
- Subject: Re: PATCH turning FUNCTION_OK_FOR_SIBCALL into target hook
- References: <20021001062006.GN21224@kennel> <20021001202203.GK12410@redhat.com>
> Applied.
Thank you. However, I did not include the updated documentation in my
last email. Please find the changes attached to this message. Hope it's
alright.
I'm looking forward to your feedback.
Cheers,
Andi.
2002-10-03 Andreas Bauer <baueran@in.tum.de>
doc/tm.texi (FUNCTION_OK_FOR_SIBCALL): Remove.
(TARGET_FUNCTION_OK_FOR_SIBCALL): New.
Index: tm.texi
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.159.2.7
diff -u -p -r1.159.2.7 tm.texi
--- tm.texi 1 Oct 2002 17:32:35 -0000 1.159.2.7
+++ tm.texi 3 Oct 2002 06:46:26 -0000
@@ -4228,18 +4228,18 @@ the function prologue. Normally, the pr
@subsection Permitting tail calls
@cindex tail calls
-@table @code
-@findex FUNCTION_OK_FOR_SIBCALL
-@item FUNCTION_OK_FOR_SIBCALL (@var{decl})
-A C expression that evaluates to true if it is ok to perform a sibling
-call to @var{decl} from the current function.
+@deftypefn {Target Hook} bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree @var{decl},
tree @var{exp})
+True if it is ok to do sibling call optimization for the specified
+call expression @var{exp}. @var{decl} will be the called function,
+or NULL if this is an indirect call.
It is not uncommon for limitations of calling conventions to prevent
tail calls to functions outside the current unit of translation, or
-during PIC compilation. Use this macro to enforce these restrictions,
+during PIC compilation. The hook is used to enforce these restrictions,
as the @code{sibcall} md pattern can not fail, or fall over to a
-``normal'' call.
-@end table
+``normal'' call. The criteria for successful sibling call optimization
+may vary greatly between different architectures.
+@end deftypefn
@node Varargs
@section Implementing the Varargs Macros