]> git.ipfire.org Git - thirdparty/gcc.git/commit
AVR: target/87376 - Use nop_general_operand for DImode inputs.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 5 Jul 2024 11:22:12 +0000 (13:22 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Fri, 5 Jul 2024 11:48:19 +0000 (13:48 +0200)
commit5f4a60c43d5cd805add6529b4528c35893c283ae
tree7dbc92d7e068ff539a3992ce3155fd3647db89a5
parent92a6ff14c4d725beb8b36295b6720f182e4bffbc
AVR: target/87376 - Use nop_general_operand for DImode inputs.

The avr-dimode.md expanders have code like  emit_move_insn(acc_a, operands[1])
where acc_a is a hard register and operands[1] might be a non-generic
address-space memory reference.  Such loads may clobber hard regs since
some of them are implemented as libgcc calls /and/ 64-moves are
expanded as eight byte-moves, so that acc_a or acc_b might be clobbered
by such a load.

This patch simply denies non-generic address-space references by using
nop_general_operand for all avr-dimode.md input predicates.
With the patch, all memory loads that require library calls are issued
before the expander codes from avr-dimode.md are run.

PR target/87376
gcc/
* config/avr/avr-dimode.md: Use "nop_general_operand" instead
of "general_operand" as predicate for all input operands.

gcc/testsuite/
* gcc.target/avr/torture/pr87376.c: New test.

(cherry picked from commit 23a0935262d6817097406578b1c70563f424804b)
gcc/config/avr/avr-dimode.md
gcc/testsuite/gcc.target/avr/torture/pr87376.c [new file with mode: 0644]