Hi, The attached patch should fix PR 101737. It's a rather obvious oversight. Sanity tested with 'make all-gcc'. Committed to master, gcc-13, gcc-12, gcc-11.
Cheers, Oleg gcc/ChangeLog: PR target/101737 * config/sh/sh.cc (sh_is_nott_insn): Handle case where the input is not an insn, but e.g. a code label.
From 4ff8ffe7331cf174668cf5c729fd68ff327ab014 Mon Sep 17 00:00:00 2001 From: Oleg Endo <olege...@gcc.gnu.org> Date: Sun, 3 Mar 2024 14:58:58 +0900 Subject: [PATCH] SH: Fix 101737 gcc/ChangeLog: PR target/101737 * config/sh/sh.cc (sh_is_nott_insn): Handle case where the input is not an insn, but e.g. a code label. --- gcc/config/sh/sh.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/sh/sh.cc b/gcc/config/sh/sh.cc index 27777c4..ef3c2e6 100644 --- a/gcc/config/sh/sh.cc +++ b/gcc/config/sh/sh.cc @@ -11766,9 +11766,10 @@ sh_insn_operands_modified_between_p (rtx_insn* operands_insn, negates the T bit and stores the result in the T bit. */ bool sh_is_nott_insn (const rtx_insn* i) { - return i != NULL && GET_CODE (PATTERN (i)) == SET + return i != NULL_RTX && PATTERN (i) != NULL_RTX + && GET_CODE (PATTERN (i)) == SET && t_reg_operand (XEXP (PATTERN (i), 0), VOIDmode) && negt_reg_operand (XEXP (PATTERN (i), 1), VOIDmode); } -- libgit2 1.6.4