Thanks Ian for your help. If I set the frame pointer required hook (using 
SUBTARGET_FRAME_POINTER_REQUIRED and TARGET_FRAME_POINTER_REQUIRED) it will set 
the frame-pointer for all the functions..am I correct?  I would like to force 
it to use the frame-pointer for a certain functions in a program that I figure 
out during compile time. Is there a feature to do this? If one doesn't exist, 
then how much of a major change is this to the GCC mainline for me to add this 
functionality?

Thanks,

Balaji V. Iyer.


-----Original Message-----
From: Ian Lance Taylor [mailto:i...@google.com] 
Sent: Friday, April 08, 2011 6:32 PM
To: Iyer, Balaji V
Cc: gcc@gcc.gnu.org
Subject: Re: Frame Pointer Usage

"Iyer, Balaji V" <balaji.v.i...@intel.com> writes:

>       I have a question regarding using frame pointers. I have a scenario 
> where I need to use the frame for certain functions and for the other 
> functions it can optimize it out. I see there is a flag called  
> "-fno-omit-frame-pointer", which will keep the frame pointer for all the 
> functions. Is there a way I can keep/remove the frame for a per-function 
> basis? If this functionality is not present in GCC and if I want to add such 
> a functionality, where/how should I go about implementing it?

That is how gcc behaves anyhow.  It will use a frame pointer if it needs
one, whether or not -fomit-frame-pointer is in effect.  To control this
in your backend, see the frame_pointer_required target hook.

Ian

Reply via email to