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