diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 4debdcd1247..c4f92bde061 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1003,7 +1003,7 @@ (match_operand:GPR 2 "memory_operand")) (set (reg CC_REGNUM) (compare (match_dup 0) (match_operand:GPR 1 "const0_operand")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM + "s390_match_ccmode (peep2_next_insn (1), CCSmode) && TARGET_EXTIMM && GENERAL_REG_P (operands[0]) && satisfies_constraint_T (operands[2]) && !contains_constant_pool_address_p (operands[2])" diff --git a/gcc/testsuite/gcc.target/s390/20211119.c b/gcc/testsuite/gcc.target/s390/20211119.c new file mode 100644 index 00000000000..b9d216389f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/20211119.c @@ -0,0 +1,12 @@ +/* { dg-do run { target { s390_useable_hw } } } */ +/* { dg-options "-Os -march=z10" } */ +signed char a; +int b = -925974181, c; +unsigned *d = &b; +int *e = &c; +int main() { + *e = ((217 ^ a) > 585) < *d; + if (c != 1) + __builtin_abort(); + return 0; +}