I have checked in this patch to fix PR target/81613.

Andreas.

        PR target/81613
        * config/m68k/m68k.md (moveq feeding equality comparison): Check
        that the registers are different.
---
 gcc/config/m68k/m68k.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index cd417e47a7..628e3889bb 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -7735,7 +7735,8 @@
   "peep2_reg_dead_p (2, operands[0])
    && peep2_reg_dead_p (2, operands[2])
    && (operands[3] == pc_rtx || operands[4] == pc_rtx)
-   && DATA_REG_P (operands[2])"
+   && DATA_REG_P (operands[2])
+   && !rtx_equal_p (operands[0], operands[2])"
   [(set (match_dup 2) (plus:SI (match_dup 2) (match_dup 6)))
    (set (cc0) (compare (match_dup 2) (const_int 0)))
    (set (pc) (if_then_else (match_op_dup 5 [(cc0) (const_int 0)])
-- 
2.14.1

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to