This is the mail archive of the gcc-patches@gcc.gnu.org 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: [PATCH] Support multiple registers for the frame pointer


Hello

On 04/11/2019 04:22 pm, Georg-Johann Lay wrote:
> The avr port already uses 2 hard-reg frame pointer ever since...
>
> Does this patch has an impact on the avr port and its handling of
> the frame pointer?

I am not familiar with the AVR port, but looking at the source, it looks like it prevents the clobbering by defining FRAME_POINTER_REGNUM+1 as eliminable in ELIMINABLE_REGS, so it will be added to eliminable_regset and ira_no_alloc_regs (when using the FP) in ira_setup_eliminable_regset anyway. It does not have a separate HARD_FRAME_POINTER_REGNUM, so the code in the 'if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)' block does not affect this port.

I don't understand how the elimination from FRAME_POINTER_REGNUM+1 to STACK_POINTER_REGNUM+1 works though - avr_initial_elimination_offset doesn't appear to deal with the second word at all...

All in all, I don't believe that it will affect the AVR port - at worst, it is simply redundant for that platform. I don't have an AVR board to confirm that on though. In any case, I don't think it is ever wrong to prevent all the constituent registers of the FP from being allocated when the frame pointer is in use.

Thanks,

Kwok


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