CONFIG_FRAME_POINTER on ppc/ppc64?

Paul Mackerras paulus at samba.org
Tue Aug 16 15:23:50 EST 2005


David Edelsohn writes:

> Kumar> I'm assuming that's a guess.  The reason I ask that is my memory  
> Kumar> serves correctly r31 is used as the frame pointer if compiled that  
> Kumar> way.  Maybe some GCC expert can chime in.  I'll copy David Edelsohn  
> Kumar> and see if I get a response :)
> 
> 	I am missing some context here.  On both 32-bit PowerPC Linux
> (PowerPC SVR4) and 64-bit PowerPC Linux, GPR r31 is used as the frame
> pointer.  PowerPC does not have a dedicated frame pointer and the PowerPC
> ABI does not require an independent frame pointer in a function at all
> times, so it can be omitted by default.  If the frame pointer is not
> referenced for any unique needs, uses of the frame pointer are adjusted to
> reference the stack pointer.  GCC only retains the PowerPC frame pointer
> when dynamic stack allocation (alloca) is used within a function.
> -fomit-frame-pointer has no effect on PowerPC because it is enabled by
> default.

OK, my memory was at fault then.

The reason for having the kernel config option is that it is
impossible to get reliable stack traces on x86 without frame pointers.
On PPC, because the stack frames are always linked together, even if
you don't use a frame pointer, the frame pointer doesn't help in
getting stack traces.  Thus there is no point in having the kernel
config option.

Paul.



More information about the Linuxppc64-dev mailing list