From: Oleg Endo Date: Mon, 23 Oct 2023 13:08:37 +0000 (+0900) Subject: SH: Fix PR 111001 X-Git-Tag: basepoints/gcc-15~5277 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=267e369afbb963d8d84d7a9f0cb9fb18672d99a8;p=thirdparty%2Fgcc.git SH: Fix PR 111001 gcc/ChangeLog: PR target/111001 * config/sh/sh_treg_combine.cc (sh_treg_combine::record_set_of_reg): Skip over nop move insns. --- diff --git a/gcc/config/sh/sh_treg_combine.cc b/gcc/config/sh/sh_treg_combine.cc index 9f6a89fa71fb..9b35960c8c2b 100644 --- a/gcc/config/sh/sh_treg_combine.cc +++ b/gcc/config/sh/sh_treg_combine.cc @@ -729,7 +729,14 @@ sh_treg_combine::record_set_of_reg (rtx reg, rtx_insn *start_insn, } else if (REG_P (new_entry.cstore.set_src ())) { - // If it's a reg-reg copy follow the copied reg. + // If it's a reg-reg copy follow the copied reg, but ignore + // nop copies of the reg onto itself. + if (REGNO (new_entry.cstore.set_src ()) == REGNO (reg)) + { + i = prev_nonnote_nondebug_insn_bb (i); + continue; + } + new_entry.cstore_reg_reg_copies.push_back (new_entry.cstore); reg = new_entry.cstore.set_src (); i = new_entry.cstore.insn;