SPRAB89A September 2011 – March 2014
When a caller-save register is live across a call, but the callee is known not to modify that register, the compiler may optimize the caller function code by omitting the save and restore around the call. This arises when the definition has been seen, or when calling helper functions have special conventions as described in Section 8.4.
However, the registers B30 and B31 are designated as potentially modified by any call that crosses a section boundary, even if the definition has been seen or when calling helper functions. This is so that if the call requires a far-call trampoline (Section 5.4), B30 and B31 are available as scratch registers in the trampoline.
Additionally, the lazy binding mechanism for Linux requires caller-save registers to be available for the stub functions that implement lazy binding. The compiler must not optimize a call site when the callee may be imported and therefore potentially called via lazy binding.
Calls within the same section never require trampolines; for such intra-section calls B30 and B31 are treated no differently than other caller-save registers.