This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: tail call optimizations
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: tail call optimizations
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Mon, 20 Mar 2000 12:14:57 +0000
- Cc: gcc-patches at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
rth@cygnus.com said:
> Here's the final version, which I've just checked in.
Excellent. Now I can start to remove the hack that is in the ARM backend,
but only worked for some highly restricted cases.
However:
1) calls.c makes reference to md patterns sibcall, sibcall_value,
sibcall_pop, sibcall_value_pop and sibcall_epilogue. Only the last of
these has any documentation in md.texi. What do the others do? What form
do they take?
2) Can I assume that the compiler proper will not try to make a sibcall if
the function might be passed the address of something in the current frame
(eg address of a local variable, result of alloca())?
3) md.texi says
"The @code{sibcall_epilogue} pattern must not clobber any arguments used
for parameter passing or any stack slots for arguments passed to the
current function."
Maybe I've missed the point here, but how can I be sure that I won't do
the latter? After all, the stack frame has to unwound by the epilogue
instructions.
R.
PS. You, or was it Mark, said that some of the code would probably go
when we moved to a tree-based implementation. Will that still work with
tail-calling libcalls? (For that matter, does the current implementation
work with libcalls?)