diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2024-09-06 11:23:06 +0200 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2024-09-18 11:17:23 +0200 |
commit | 5bfb91c14f98f6750281217f737b3d95c4e73584 (patch) | |
tree | 746d0d63127ddcf462208266fe160a0393e6d1ad /gcc/config | |
parent | cdeebc71c48db922b14d34c361e15660c1e31fc1 (diff) | |
download | gcc-5bfb91c14f98f6750281217f737b3d95c4e73584.zip gcc-5bfb91c14f98f6750281217f737b3d95c4e73584.tar.gz gcc-5bfb91c14f98f6750281217f737b3d95c4e73584.tar.bz2 |
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.
gcc/testsuite/
* gcc.target/avr/torture/lra-pr116324.c: New test.
* gcc.target/avr/torture/lra-pr116325.c: New test.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/avr/avr.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 1cf4180..3fa2ee7 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -308,12 +308,19 @@ enum reg_class { #define STATIC_CHAIN_REGNUM ((AVR_TINY) ? 18 :2) -#define ELIMINABLE_REGS { \ +#define RELOAD_ELIMINABLE_REGS { \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \ { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ { FRAME_POINTER_REGNUM + 1, STACK_POINTER_REGNUM + 1 } } +#define ELIMINABLE_REGS \ + { \ + { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM }, \ + { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM }, \ + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM } \ + } + #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ OFFSET = avr_initial_elimination_offset (FROM, TO) |