Next: Stack Smashing Protection, Previous: Profiling, Up: Stack and Calling

#### 15.10.13 Permitting tail calls

— Target Hook: bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree decl, tree exp)

> True if it is ok to do sibling call optimization for the specified call expression exp. 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. The hook is used to enforce these restrictions, as the `sibcall` md pattern can not fail, or fall over to a “normal” call. The criteria for successful sibling call optimization may vary greatly between different architectures.

— Target Hook: void TARGET_EXTRA_LIVE_ON_ENTRY (bitmap *regs)

> Add any hard registers to regs that are live on entry to the function. This hook only needs to be defined to provide registers that cannot be found by examination of FUNCTION_ARG_REGNO_P, the callee saved registers, STATIC_CHAIN_INCOMING_REGNUM, STATIC_CHAIN_REGNUM, TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES, FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.