https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116326

--- Comment #11 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Created attachment 59099
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59099&action=edit
Proposed patch

https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662641.html

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.
        * doc/tm.texi.in (Eliminating Frame Pointer and Arg Pointer)
        <RELOAD_ELIMINABLE_REGS>: Add documentation.
        * doc/tm.texi: Rebuild.
/testsuite/
        * gcc.target/avr/torture/lra-pr116324.c: New test.
        * gcc.target/avr/torture/lra-pr116325.c: New test.

Reply via email to