S/390: Prohibit SYMBOL_REF in UNSPECV_CAS
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 6 Sep 2018 07:38:42 +0000 (07:38 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Thu, 6 Sep 2018 07:38:42 +0000 (07:38 +0000)
commitbdb57bcb548f493107d0701a88da0cdcfa122e24
tree00482d32624436f3e7a7d7285ed9b6bb98de6bf8
parentd7252499463a4fe2c073d8a28c6c0c966e20755f
S/390: Prohibit SYMBOL_REF in UNSPECV_CAS

Inhibit constant propagation inlining SYMBOL_REF loads into
UNSPECV_CAS.  Even though reload can later undo it, the resulting
code will be less efficient.

gcc/ChangeLog:

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

PR target/80080
* config/s390/predicates.md: Add nonsym_memory_operand.
* config/s390/s390.c (s390_legitimize_cs_operand): If operand
contains a SYMBOL_REF, load it into an intermediate pseudo.
(s390_emit_compare_and_swap): Legitimize operand.
* config/s390/s390.md: Use the new nonsym_memory_operand
with UNSPECV_CAS patterns.

gcc/testsuite/ChangeLog:

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

PR target/80080
* gcc.target/s390/pr80080-3.c: New test.
* gcc.target/s390/s390.exp: Make sure the new test passes
on all optimization levels.

From-SVN: r264143
gcc/ChangeLog
gcc/config/s390/predicates.md
gcc/config/s390/s390.c
gcc/config/s390/s390.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/pr80080-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/s390.exp