[PATCH] riscv: eliminate unreliable __builtin_frame_address(1)

Jessica Clarke jrtc27 at jrtc27.com
Wed Jan 19 12:48:48 PST 2022


On 19 Jan 2022, at 20:44, Andreas Schwab <schwab at linux-m68k.org> wrote:
> 
> On Jan 19 2022, Jessica Clarke wrote:
> 
>> Leaf functions by definition don’t have callees that are trying to read
>> their frame pointer so aren’t relevant here.
> 
> ??? __builtin_frame_address(1) is about the caller, not the callee.

My point is that the only thing that can possibly read the incoming
frame pointer of a leaf function is the leaf function itself, and since
it knows where it’s putting it then there is no ABI issue, it just
remembers where it put it and loads it from there. The issue of whether
it’s part of the ABI or not only arises when you’re trying to read the
incoming frame pointer from a caller, which by definition is not a leaf
function.

Jess




More information about the linux-riscv mailing list