From mboxrd@z Thu Jan 1 00:00:00 1970 From: Morten Sylvest Olsen To: Subject: sibling call optimization Date: Mon, 22 Oct 2001 05:35:00 -0000 Message-id: X-SW-Source: 2001-10/msg00206.html 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.