IBM Z: Fix "+fvm" constraint with long doubles
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 10 Dec 2020 14:43:59 +0000 (15:43 +0100)
committerIlya Leoshkevich <iii@linux.ibm.com>
Tue, 16 Mar 2021 12:57:34 +0000 (13:57 +0100)
commit4073a09e23944b17cd1afce77025b1ea19b28ced
tree5d9bb0a528e524c62e227edc69c9995b0c002832
parent995a740cb01a0671a2082cb1ae13d0c356d4b568
IBM Z: Fix "+fvm" constraint with long doubles

When a long double is passed to an asm statement with a "+fvm"
constraint, a LRA loop occurs.  This happens, because LRA chooses the
widest register class in this case (VEC_REGS), but the code generated
by s390_md_asm_adjust() always wants FP_REGS.  Mismatching register
classes cause infinite reloading.

Fix by treating "fv" constraints as "v" in s390_md_asm_adjust().

gcc/ChangeLog:

* config/s390/s390.c (f_constraint_p): Treat "fv" constraints
as "v".

gcc/testsuite/ChangeLog:

* gcc.target/s390/vector/long-double-asm-fprvrmem.c: New test.
gcc/config/s390/s390.c
gcc/testsuite/gcc.target/s390/vector/long-double-asm-fprvrmem.c [new file with mode: 0644]