This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Frame pointer and regalloc/reload

On Wed, Nov 13, 2013 at 4:29 PM, Hendrik Greving
<> wrote:
> In case it is determined that a frame pointer is needed (in reload?),
> who is supposed to make sure that the register that will hold the
> frame pointer is not allocated for general use? We have a customized
> register allocation mechanism, but I am trying to figure out /
> understand the regular/general case first. For instance I am not sure
> if I understand the usage of the fixed_regs table w.r.t. to the frame
> pointer. Could anybody shed some light on this by any chance?

On some platforms the frame pointer is in fixed_regs.  Those platforms
are easy.

On most platforms the frame pointer is not in fixed_regs.  Those
platforms will still define FRAME_POINTER_REGNUM or

The register allocator will set the function-specific variable
frame_pointer_needed to indicate whether the function requires a frame
pointer.  This test includes a call to the target hook
frame_pointer_required.  If frame_pointer_needed is true, then
will be added to the list of registers that should not be allocated.

If you have a custom register allocator, you need to do the same.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]