This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
sibling call optimization
- To: <gcc-help at gcc dot gnu dot org>
- Subject: sibling call optimization
- From: Morten Sylvest Olsen <pbk1105 at pbk dot dk>
- Date: Mon, 22 Oct 2001 14:35:17 +0200 (CEST)
Hi all..
I'm trying to make a sibling call (or, rather making the GCC optimizer
make one) through a function pointer. This seems to be impossible?
I've read some old messages about the tailcall/siblingcalls that talked
about implementing an explicit __attribute__ or similar construct to tell
gcc to make a sibling call. This was never implemented, or?
Without knowing much about gcc internals, it seems to be this part of
gcc/calls.c responsible:
/* If the register holding the address is a callee saved
register, then we lose. We have no way to prevent that,
so we only allow calls to named functions. */
/* ??? This could be done by having the insn constraints
use a register class that is all call-clobbered. Any
reload insns generated to fix things up would appear
before the sibcall_epilogue. */
|| fndecl == NULL_TREE
Or maybe not, I've only looked at it very briefly.
- Morten
The only perfect science is hind-sight.