Splitters are not allowed to use data flow routines depending on
REG_DEAD notes since these are not recomputed by the split pass and
might therefore be outdated.  The splitter we have for load and test
FP turns a potentially stale REG_DEAD note into a clobber of that
register.  This then leads to wrong code being generated.  This patch
just removes that splitter until I can come up with a better solution.

Regression tested on GCC 8 and mainline.

The 2 load and test FP testcases fail now due to that change:
load-and-test-fp-1.c and load-and-test-fp-2.c

I'll leave it that way to remind me to fix that.

Committed to mainline, GCC 8, and GCC 7.

Andreas

gcc/ChangeLog:

2019-02-05  Andreas Krebbel  <kreb...@linux.ibm.com>

        PR target/88856
        * config/s390/s390.md: Remove load and test FP splitter.
---
 gcc/config/s390/s390.md | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 722d924..9033672 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -1357,10 +1357,11 @@
 ; (TF|DF|SF|TD|DD|SD) instructions
 
 
-; load and test instructions turn SNaN into QNaN what is not
+; FIXME: load and test instructions turn SNaN into QNaN what is not
 ; acceptable if the target will be used afterwards.  On the other hand
 ; they are quite convenient for implementing comparisons with 0.0. So
-; try to enable them via splitter if the value isn't needed anymore.
+; try to enable them via splitter/peephole if the value isn't needed anymore.
+; See testcases: load-and-test-fp-1.c and load-and-test-fp-2.c
 
 ; ltxbr, ltdbr, ltebr, ltxtr, ltdtr
 (define_insn "*cmp<mode>_ccs_0"
@@ -1373,22 +1374,6 @@
    [(set_attr "op_type" "RRE")
     (set_attr "type"  "fsimp<mode>")])
 
-(define_split
-  [(set (match_operand 0 "cc_reg_operand")
-       (compare (match_operand:FP 1 "register_operand")
-                (match_operand:FP 2 "const0_operand")))]
-  "TARGET_HARD_FLOAT && REG_P (operands[1]) && dead_or_set_p (insn, 
operands[1])"
-  [(parallel
-    [(set (match_dup 0) (match_dup 3))
-     (clobber (match_dup 1))])]
- {
-   /* s390_match_ccmode requires the compare to have the same CC mode
-      as the CC destination register.  */
-   operands[3] = gen_rtx_COMPARE (GET_MODE (operands[0]),
-                                 operands[1], operands[2]);
- })
-
-
 ; VX: TFmode in FPR pairs: use cxbr instead of wfcxb
 ; cxtr, cdtr, cxbr, cdbr, cebr, cdb, ceb, wfcsb, wfcdb
 (define_insn "*cmp<mode>_ccs"
-- 
2.7.4

Reply via email to