linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* CONFIG_FRAME_POINTER on ppc/ppc64?
@ 2005-08-15 18:25 Kumar Gala
  2005-08-15 23:08 ` Paul Mackerras
  0 siblings, 1 reply; 6+ messages in thread
From: Kumar Gala @ 2005-08-15 18:25 UTC (permalink / raw)
  To: linuxppc-dev list; +Cc: linuxppc64-dev

Is there any reason we dont allow building with frame pointers on ppc/ 
ppc64?

- kumar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_FRAME_POINTER on ppc/ppc64?
  2005-08-15 18:25 CONFIG_FRAME_POINTER on ppc/ppc64? Kumar Gala
@ 2005-08-15 23:08 ` Paul Mackerras
  2005-08-16  3:41   ` Kumar Gala
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Mackerras @ 2005-08-15 23:08 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, linuxppc64-dev

> Is there any reason we dont allow building with frame pointers on ppc/ 
> ppc64?

Because -fomit-frame-pointer and -fno-omit-frame-pointer have no
effect on ppc or ppc64, I assume. :)

Paul.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_FRAME_POINTER on ppc/ppc64?
  2005-08-15 23:08 ` Paul Mackerras
@ 2005-08-16  3:41   ` Kumar Gala
  2005-08-16  4:03     ` David Edelsohn
  2005-08-16  9:44     ` Segher Boessenkool
  0 siblings, 2 replies; 6+ messages in thread
From: Kumar Gala @ 2005-08-16  3:41 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list, David Edelsohn, linuxppc64-dev


On Aug 15, 2005, at 6:08 PM, Paul Mackerras wrote:

>> Is there any reason we dont allow building with frame pointers on  
>> ppc/
>>
>
>
>> ppc64?
>>
>
> Because -fomit-frame-pointer and -fno-omit-frame-pointer have no
> effect on ppc or ppc64, I assume. :)

I'm assuming that's a guess.  The reason I ask that is my memory  
serves correctly r31 is used as the frame pointer if compiled that  
way.  Maybe some GCC expert can chime in.  I'll copy David Edelsohn  
and see if I get a response :)

- kumar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_FRAME_POINTER on ppc/ppc64?
  2005-08-16  3:41   ` Kumar Gala
@ 2005-08-16  4:03     ` David Edelsohn
  2005-08-16  5:23       ` Paul Mackerras
  2005-08-16  9:44     ` Segher Boessenkool
  1 sibling, 1 reply; 6+ messages in thread
From: David Edelsohn @ 2005-08-16  4:03 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, linuxppc64-dev

>>>>> Kumar Gala writes:

>> Because -fomit-frame-pointer and -fno-omit-frame-pointer have no
>> effect on ppc or ppc64, I assume. :)

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.

David

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_FRAME_POINTER on ppc/ppc64?
  2005-08-16  4:03     ` David Edelsohn
@ 2005-08-16  5:23       ` Paul Mackerras
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Mackerras @ 2005-08-16  5:23 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list, David Edelsohn, linuxppc64-dev

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CONFIG_FRAME_POINTER on ppc/ppc64?
  2005-08-16  3:41   ` Kumar Gala
  2005-08-16  4:03     ` David Edelsohn
@ 2005-08-16  9:44     ` Segher Boessenkool
  1 sibling, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2005-08-16  9:44 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc64-dev, David Edelsohn, linuxppc-dev list

>> Because -fomit-frame-pointer and -fno-omit-frame-pointer have no
>> effect on ppc or ppc64, I assume. :)
>
> I'm assuming that's a guess.  The reason I ask that is my memory 
> serves correctly r31 is used as the frame pointer if compiled that 
> way.  Maybe some GCC expert can chime in.  I'll copy David Edelsohn 
> and see if I get a response :)

Yes, GPR31 is used as frame pointer.  All optimization
levels other than -O0 enable -fomit-frame-pointer.  But
-fno-omit-frame-pointer certainly works.


Segher

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-16  9:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-15 18:25 CONFIG_FRAME_POINTER on ppc/ppc64? Kumar Gala
2005-08-15 23:08 ` Paul Mackerras
2005-08-16  3:41   ` Kumar Gala
2005-08-16  4:03     ` David Edelsohn
2005-08-16  5:23       ` Paul Mackerras
2005-08-16  9:44     ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).