]> git.ipfire.org Git - thirdparty/gcc.git/commit
AVR: ad target/114100 - Don't print unused frame pointer adjustments.
authorGeorg-Johann Lay <avr@gjlay.de>
Sun, 3 Mar 2024 17:15:58 +0000 (18:15 +0100)
committerGeorg-Johann Lay <avr@gjlay.de>
Sun, 3 Mar 2024 17:15:58 +0000 (18:15 +0100)
commitc0f5b6caff669037444506cb6008a378356ec209
tree757d6b50f7d89eeeb514258f2becfca1012558ed
parentdae3456965064c9664c097c785ae9bf9fa203fa0
AVR: ad target/114100 - Don't print unused frame pointer adjustments.

Without -mfuse-add, when fake reg+offset addressing is used, the
output routines are saving some instructions when the base reg
is unused after.  This patch adds that optimization for the case
when the base is the frame pointer and the frame pointer adjustments
are split away from the move insn by -mfuse-add in .split2.
   Direct usage of reg_unused_after is not possible because that
function looks at the destination of the current insn, which won't
work for offsetting the frame pointer in printing PLUS code.
It can use an extended version of _reg_unused_after though.

gcc/
PR target/114100
* config/avr/avr-protos.h (_reg_unused_after): Remove proto.
* config/avr/avr.cc (_reg_unused_after): Make static.  And
add 3rd argument to skip the current insn.
(reg_unused_after): Adjust call of reg_unused_after.
(avr_out_plus_1) [AVR_TINY && -mfuse-add >= 2]: Don't output
unneeded frame pointer adjustments.
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.cc