On Sun, Sep 8, 2024 at 12:22 PM Georg-Johann Lay <a...@gjlay.de> wrote:
>
> The reason for PR116326 is that LRA and reload require different
> ELIMINABLE_REGS for a multi-register frame pointer.  As ELIMINABLE_REGS
> is used to initialize static const objects, it is not possible to make
> ELIMINABLE_REGS dependent on -mlra.
>
> It was also concluded that it is not desirable to adjust reload so that
> it behaves like LRA, see
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116326#c8
>
> This patch adds a new macro RELOAD_ELIMINABLE_REGS that takes
> precedence over ELIMINABLE_REGS in reload1.cc.
>
> The patch was proposed by H.J. Lu and is only required for trunk.

Can you add documentation to tm.texi please?  Otherwise looks good, but
please give others a chance to comment.

Thanks,
Richard.

> Johann
>
> --
>
> reload1.cc: rtl-optimization/116326 - Use RELOAD_ELIMINABLE_REGS.
>
> The new macro is required because reload and LRA are using different
> representations for a multi-register frame pointer.  As ELIMINABLE_REGS
> is used to initialize static const objects, it can't depend on -mlra.
>
>         PR rtl-optimization/116326
> gcc/
>         * reload1.cc (reg_eliminate_1): Initialize from
>         RELOAD_ELIMINABLE_REGS if defined.
>         * config/avr/avr.h (RELOAD_ELIMINABLE_REGS): Copy from 
> ELIMINABLE_REGS.
>         (ELIMINABLE_REGS): Don't mention sub-regnos of the frame pointer.
> gcc/testsuite/
>         * gcc.target/avr/torture/lra-pr116324.c: New test.
>         * gcc.target/avr/torture/lra-pr116325.c: New test.

Reply via email to