The cost of guaranteed tail call optimization is that you have to adopt the Pascal (callee side) convention for stack frame cleanup, so functions can’t reuse outgoing argument space. Does it matter in practice? Dunno.
The problem is if you tail call a function that takes more argument space than you do.
-
-
Is moving the stack pointer by the delta, moving the return address, and then proceeding as normal a workable approach for that case? Or, adopt something neither fish nor fowl like this: https://eighty-twenty.org/2012/11/27/arm-tail-calling-convention … (I may be entirely missing your point!! Sorry if so!)
-
I haven’t thought through that in detail, but it’s definitely not the C ABI anymore if you do that.
- 6 more replies
New conversation -
-
-
(What you describe is called "sibling call optimization", and it's a special case of TCO. GCC and LLVM will do sibling call optimization since it works with the C calling convention.)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.