aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Dapp <rdapp@linux.ibm.com>2022-02-17 19:59:51 +0100
committerRobin Dapp <rdapp@linux.ibm.com>2022-02-17 19:59:51 +0100
commitfac15bf84807a58f83c741b1034c1bc96348319d (patch)
treee3311a0966d4562eaa82a4a81ba7d2d918c7e7c0
parent73a118c209fcbb73c3439ca70fb233a5dc87daf7 (diff)
downloadgcc-fac15bf84807a58f83c741b1034c1bc96348319d.zip
gcc-fac15bf84807a58f83c741b1034c1bc96348319d.tar.gz
gcc-fac15bf84807a58f83c741b1034c1bc96348319d.tar.bz2
rs6000: Workaround for new ifcvt behavior [PR104335].
Since r12-6747-gaa8cfe785953a0 ifcvt passes a "cc comparison" i.e. the representation of the result of a comparison to the backend. rs6000_emit_int_cmove () is not prepared to handle this. Therefore, this patch makes it return false in such a case. PR target/104335 gcc/ChangeLog: * config/rs6000/rs6000.cc (rs6000_emit_int_cmove): Return false if the expected comparison's first operand is of mode MODE_CC.
-rw-r--r--gcc/config/rs6000/rs6000.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index e76c017..32a13cd 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -16215,6 +16215,12 @@ rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
if (mode != SImode && (!TARGET_POWERPC64 || mode != DImode))
return false;
+ /* PR104335: We now need to expect CC-mode "comparisons"
+ coming from ifcvt. The following code expects proper
+ comparisons so better abort here. */
+ if (GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC)
+ return false;
+
/* We still have to do the compare, because isel doesn't do a
compare, it just looks at the CRx bits set by a previous compare
instruction. */