public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Oleg Endo <olegendo@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-4862] SH: Fix PR 111001
Date: Mon, 23 Oct 2023 13:11:16 +0000 (GMT)	[thread overview]
Message-ID: <20231023131116.7534C3858D37@sourceware.org> (raw)

https://gcc.gnu.org/g:267e369afbb963d8d84d7a9f0cb9fb18672d99a8

commit r14-4862-g267e369afbb963d8d84d7a9f0cb9fb18672d99a8
Author: Oleg Endo <olegendo@gcc.gnu.org>
Date:   Mon Oct 23 22:08:37 2023 +0900

    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:
---
 gcc/config/sh/sh_treg_combine.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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;

                 reply	other threads:[~2023-10-23 13:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231023131116.7534C3858D37@sourceware.org \
    --to=olegendo@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).