S/390: Fix conditional returns on z196+
commit4c5541774b947a71e17cac912737e873511d8224
authoriii <iii@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Sep 2018 14:21:03 +0000 (24 14:21 +0000)
committeriii <iii@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Sep 2018 14:21:03 +0000 (24 14:21 +0000)
tree11ffbecfac733e0290e4bb15c7e73e4330059707
parent2ace2ebcdbe7da20ace841a4cae95bdd90fbde89
S/390: Fix conditional returns on z196+

S/390 epilogue ends with (parallel [(return) (use %r14)]) instead of
the more usual (return) or (simple_return).  This sequence is not
recognized by the conditional return logic in try_optimize_cfg ().

This was introduced for processors older than z196, where it is
sometimes profitable to use call-clobbered register for returning
instead of %r14.  On newer processors we always return via %r14,
for which the fact that it's used is already reflected by
EPILOGUE_USES.  In this case a simple (return) suffices.

This patch changes return_use () to emit simple (return)s when
returning via %r14.  The resulting sequences are recognized by the
conditional return logic in try_optimize_cfg ().

gcc/ChangeLog:

2018-09-24  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/80080
* config/s390/s390.c (s390_emit_epilogue): Do not use PARALLEL
RETURN+USE when returning via %r14.

gcc/testsuite/ChangeLog:

2018-09-24  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/80080
* gcc.target/s390/risbg-ll-3.c: Expect conditional returns.
* gcc.target/s390/zvector/vec-cmp-2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264535 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/s390/s390.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/risbg-ll-3.c
gcc/testsuite/gcc.target/s390/zvector/vec-cmp-2.c