aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJuergen Christ <jchrist@linux.ibm.com>2024-12-06 18:52:36 +0100
committerJuergen Christ <jchrist@linux.ibm.com>2024-12-09 15:13:02 +0100
commitbdc572f9a42b6a68dec1a5593d5311f45bd29cc9 (patch)
treedd4b67538143f4792eaca6eeef37e37110e4c27b /gcc/config
parent9ed094a817ecaf43c79505286759b88eb0555be2 (diff)
downloadgcc-bdc572f9a42b6a68dec1a5593d5311f45bd29cc9.zip
gcc-bdc572f9a42b6a68dec1a5593d5311f45bd29cc9.tar.gz
gcc-bdc572f9a42b6a68dec1a5593d5311f45bd29cc9.tar.bz2
s390: Fix UNSPEC_CC_TO_INT canonicalization
Canonicalization of comparisons for UNSPEC_CC_TO_INT missed one case causing unnecessarily complex code. This especially seems to hit the Linux kernel. gcc/ChangeLog: * config/s390/s390.cc (s390_canonicalize_comparison): Add missing UNSPEC_CC_TO_INT case. gcc/testsuite/ChangeLog: * gcc.target/s390/ccusage.c: New test. Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/s390/s390.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index cec0548..573b229 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -1859,7 +1859,7 @@ s390_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
&& CONST_INT_P (XEXP (*op0, 1))
&& CONST_INT_P (*op1)
&& INTVAL (XEXP (*op0, 1)) == -3
- && *code == EQ)
+ && (*code == EQ || *code == NE))
{
if (INTVAL (*op1) == 0)
{