Hi,
FYI besides what Ian had mentioned, you can refer to gcc/function.h file for
the classification of functions by GCC. You can check out how GCC
categorizes a function by debugging cc1 using "gdb --args"
(http://gcc.gnu.org/wiki/DebuggingGCC). You can probably put a break point
at your prologue function and can see the contents of structure "cfun".
Correct me if I am wrong.
Gcc allows you to control the same at application level using attributes.
An attribute to function like
__attribute__((optimize("-fno-omit-frame-pointer")))
may not omit the frame pointer for the concerned function.
-Sumanth G
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Iyer,
Balaji V
Sent: Tuesday, April 12, 2011 2:27 AM
To: Ian Lance Taylor
Cc: [email protected]
Subject: RE: Frame Pointer Usage
Yes, that is what I want. Thank you!
-Balaji V. Iyer.
-----Original Message-----
From: Ian Lance Taylor [mailto:[email protected]]
Sent: Monday, April 11, 2011 4:40 PM
To: Iyer, Balaji V
Cc: [email protected]
Subject: Re: Frame Pointer Usage
"Iyer, Balaji V" <[email protected]> writes:
> 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?
In current gcc, the frame pointer required hook is a function
implemented in the backend. Your backend can decide, on a
function-by-function basis, whether a frame pointer is required. It
seems to me that that is what you want. Please let me know if I
misunderstand.
I'm not sure why you are referring to SUBTARGET_FRAME_POINTER_REQUIRED.
A few backends define that macro, most do not.
Ian