[llvmlinux] Builtin: stack pointer

Behan Webster behanw at converseincode.com
Thu Mar 27 14:21:10 UTC 2014

On 03/27/14 04:27, Tim Northover wrote:
> On 27 March 2014 10:25, Renato Golin <renato.golin at linaro.org> wrote:
>> On 27 March 2014 10:12, Andreas Schwab <schwab at suse.de> wrote:
>>> Can't you use __builtin_frame_address (0) instead?
>> That would give me the frame pointer, not the stack pointer, and the
>> user would have to calculate manually the offset to get the actual
>> stack pointer, which would be target-specific, possibly making it even
>> worse. Is that what you meant?
> I think this intrinsic makes no more guarantees than
> __builtin_frame_address. In neither case can you derive the actual,
> current stack pointer with certainty.

> As far as I'm aware, the users don't actually care about precision
> (they'd better not!).The difference is that this one doesn't force a
> frame pointer to be created, which can be good for optimised code.
In the embedded case, compiling the kernel without a frame pointer is 
also quite common.


Behan Webster
behanw at converseincode.com

More information about the LLVMLinux mailing list