The attached patch fixes PR 101177. Committed to master, cherry-picked to GCC-13, GCC-12 and GCC-11. Sanity tested with 'make all-gcc'.
Cheers, Oleg gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result.
From 3ce4e99303d01d348229cca22bf8d3dd63004e01 Mon Sep 17 00:00:00 2001 From: Oleg Endo <olege...@gcc.gnu.org> Date: Fri, 20 Oct 2023 18:48:34 +0900 Subject: [PATCH] SH: Fix PR 101177 Fix accidentally inverted comparison. gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result. --- gcc/config/sh/sh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 76e7774..93374c6 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -841,9 +841,9 @@ rtx reg = operands[0]; if (SUBREG_P (reg)) reg = SUBREG_REG (reg); gcc_assert (REG_P (reg)); - if (find_regno_note (curr_insn, REG_DEAD, REGNO (reg)) != NULL_RTX) + if (find_regno_note (curr_insn, REG_DEAD, REGNO (reg)) == NULL_RTX) FAIL; /* FIXME: Maybe also search the predecessor basic blocks to catch more cases. */ -- libgit2 1.3.2