"Naveen H. S" <navee...@kpitcummins.com> writes:

> The FRAME_POINTER_REGNUM is defined a pseudo register in header file.
> I am using the following macros in header file to eliminate the pseudo
> arg pointer and frame pointer.
> However, there are some instances of frame pointer in the assembly code.


> #define ELIMINABLE_REGS                     \
>  {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},   \
>   {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},  \
>   {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}}

In gcc, some functions must have a frame pointer.  E.g., a function
which calls alloca or allocates a dynamically sized array.  So you can
not always eliminate the frame pointer in favor of the stack pointer.

You can address this in one of two ways.  First, you can simply make
FRAME_POINTER_REGNUM be a hard register.  Second, you can define a
hard register HARD_FRAME_POINTER_REGNUM.  Either way, it should not be
a fixed register.  In the latter case, have an elimination from
FRAME_POINTER_REGNUM to HARD_FRAME_POINTER_REGNUM.  See the docs for
HARD_FRAME_POINTER_REGNUM and look at the backends which use it.

Ian

Reply via email to