For a peephole2 condition variable insn points to the first matched
insn.  In order to refer to the second matched insn use
peep2_next_insn(1) instead.

Bootstrapped and regtested on IBM Z.  Ok for mainline and gcc-{11,10,9}?

gcc/ChangeLog:

        * config/s390/s390.md (define_peephole2): Variable insn points
        to the first matched insn.  Use peep2_next_insn(1) to refer to
        the second matched insn.
---
 gcc/config/s390/s390.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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])"
-- 
2.31.1

Reply via email to