From c5f06528e56621ce683517a5d2ca30e6b3c7b71c Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Thu, 23 Feb 2017 00:50:46 +0100 Subject: [PATCH] rs6000: Fix fsel pattern (PR79211) The fsel define_insn uses fpr_reg_operand for its predicates. This won't work because passes can put a hard register in the operands: in the testcase, combine likes to forward the parameter registers to what then is still an smin, and then split1 uses "*s3_fpr" (which has gpc_reg_operand). And then we have a GPR in the operand, which does not match fpr_reg_operand. It seems to me the predicates should be gpc_reg_operand here as well. This patch changes that. PR target/79211 * config/rs6000/rs6000.md (*fsel4): Use gpc_reg_operand instead of fpr_reg_operand. From-SVN: r245667 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.md | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9654753153e..7155850e3a9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-02-22 Segher Boessenkool + + PR target/79211 + * config/rs6000/rs6000.md (*fsel4): Use + gpc_reg_operand instead of fpr_reg_operand. + 2017-02-22 Sameera Deshpande * config/mips/mips.c (mips_return_in_memory): Force FP diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 3626e783978..06c0a8b8c3e 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -4987,12 +4987,12 @@ }") (define_insn "*fsel4" - [(set (match_operand:SFDF 0 "fpr_reg_operand" "=&") + [(set (match_operand:SFDF 0 "gpc_reg_operand" "=&") (if_then_else:SFDF - (ge (match_operand:SFDF2 1 "fpr_reg_operand" "") + (ge (match_operand:SFDF2 1 "gpc_reg_operand" "") (match_operand:SFDF2 4 "zero_fp_constant" "F")) - (match_operand:SFDF 2 "fpr_reg_operand" "") - (match_operand:SFDF 3 "fpr_reg_operand" "")))] + (match_operand:SFDF 2 "gpc_reg_operand" "") + (match_operand:SFDF 3 "gpc_reg_operand" "")))] "TARGET__FPR && TARGET_PPC_GFXOPT" "fsel %0,%1,%2,%3" [(set_attr "type" "fp")]) -- 2.30.2