[arm] Avoid STRD with odd register for TARGET_ARM in output_move_double
commitf9d49e80ef9dc35ef18691a911b20131a29b7e4c
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jun 2018 13:36:35 +0000 (29 13:36 +0000)
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jun 2018 13:36:35 +0000 (29 13:36 +0000)
tree95dfcfdded0b4e95879b33b300ba999cb847f437
parentfd5afac14f42f083bb47177155170ce776746624
[arm] Avoid STRD with odd register for TARGET_ARM in output_move_double

In this testcase the user forces an odd register as the starting reg for a DFmode value.
The output_move_double function tries to store that using an STRD instruction.
But for TARGET_ARM the starting register of an STRD must be an even one.
This is always the case with compiler-allocated registers for DFmode values, but the
inline assembly forced our hand here.

This patch  restricts the STRD-emitting logic in output_move_double to not avoid
odd-numbered source registers in STRD.
I'm not a fan of the whole function, we should be exposing a lot of the logic in there
to RTL rather than at the final output stage, but that would need to be fixed separately.

* config/arm/arm.c (output_move_double): Don't allow STRD instructions
if starting source register is not even.

* gcc.target/arm/arm-soft-strd-even.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262250 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/arm-soft-strd-even.c [new file with mode: 0644]