retry zero-call-used-regs from zeroed regs
authorAlexandre Oliva <oliva@adacore.com>
Thu, 13 May 2021 00:05:26 +0000 (21:05 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 13 May 2021 00:05:26 +0000 (21:05 -0300)
commit56b9b60464e851b5874c0da79b0eefc45b543709
treebce8e12372035acc283d1be2cbe620fa2bc90d39
parentd21963ce7a87db3d4a6921a0fa98b72ea6f4e7f5
retry zero-call-used-regs from zeroed regs

default_zero_call_used_regs currently requires all potentially zeroed
registers to offer a move opcode that accepts zero as an operand.

This is not the case e.g. for ARM's r12/ip in Thumb mode, and it was
not the case of FP registers on AArch64 as of GCC 10.

This patch introduces a fallback strategy to zero out registers,
copying from registers that have already been zeroed.  Adjacent
sources to make up wider modes are also supported.

This does not guarantee that there will be some zeroed-out register to
use as the source, but it expands the cases in which the default
implementation works out of the box.

for  gcc/ChangeLog

* targhooks.c (default_zero_call_used_regs): Retry using
successfully-zeroed registers as sources.
gcc/targhooks.c