From patchwork Mon Oct 23 13:28:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 156881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1297573vqx; Mon, 23 Oct 2023 06:28:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPPVoZzq9sfYJH35RRvurWCyhG8FWhJwJp7sKfHHayOUDckTVAZI6BPgmpAZAhjz0kAfCy X-Received: by 2002:a05:620a:4094:b0:76a:db80:121d with SMTP id f20-20020a05620a409400b0076adb80121dmr8008266qko.6.1698067728260; Mon, 23 Oct 2023 06:28:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698067728; cv=pass; d=google.com; s=arc-20160816; b=Manby6z2EcG/vbZ/MbnsAzCWwgaTUdnLR5UnM2gwQS8g85sreoqKvmluh3Qlpl1BYh L7dCdKdDjqZLxq/HkQ62KUXGo8nqlYf7hsTvBwGqk0dFjfiBSa73T6S3ezRiFG1YLuKM jkmGDiVoHs4RMA+pRZuBwxif3XxWjcKuS7ARg9VGjNOTSJBAbbTaN7yo6LnbTyZYCuTd kCjptDEMzPkc/Hi/wiTpczJ9p68hKCAUT9jYNjIS94wZ/eGn+HSJ05tSKi4T1eE3zSEY zpHJCkSpKP7tn9/9Y/uf1WMwVUkBzakeTssenwFMVeJB74WMjQMunCsgdbDjit6Sp2yC 99dQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent:date:to :from:subject:message-id:arc-filter:dmarc-filter:delivered-to; bh=COJBwYe7CBCGdZuYbHBdqU7JVIlVTnojsUPDgVgujO8=; fh=8G0fvw9kezX2+yjwifXgHvTII1omy92vRpR1R+rFCOA=; b=kTg/mtNvN0BMc3JnxQhZ317bauUvRAqwDrwY4IL/nQokyqbk/nDYs8sPOoY0XFRgws eAlzHVKNovpB0BkhaSFc+hYY8z4I3lrZk1N3LM9wHHaGJRN1JqexsDGd4i0M2UdQPMe1 fO2Crwe9V/AIRoLmxd/kf+NfGIE3Xqker+VfnhCkcBi/Y6UfouK/L9hzixy2STAQ0z7V LMMP+qUzmJGUM1368R0enOiJPHjJiEGLq2QUIEVGqROM7Euav8IO8kfii8sa78x5kznJ vC4q8HBZt/2bIQjP12pDmwM5Rc2L+RU+eJgWLYbDZT7WYV+NHrTTDajqZDL/NmQip31G oh8g== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id a7-20020a05620a16c700b00767dfe07ec4si5181031qkn.164.2023.10.23.06.28.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:28:48 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0952B3858433 for ; Mon, 23 Oct 2023 13:28:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mailout09.t-online.de (mailout09.t-online.de [194.25.134.84]) by sourceware.org (Postfix) with ESMTPS id 9A9A83858D37 for ; Mon, 23 Oct 2023 13:28:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A9A83858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=t-online.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9A9A83858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=194.25.134.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698067705; cv=none; b=IMbj0vtt5NZxO1j42EmhdDsbmyZdJRuyrPNUg404LROjfkLm4ohmVKSGrkB3WrxgSDicCxrZHlezX9GCX9RQ2jpgibbAwy86N4ji6vYdtAdP8rMJlVe0n6/eXoS1YNKu9RORs7/7W1wuGIVSD0LUHjsqttyK0Sr3UFZVlv5a3co= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698067705; c=relaxed/simple; bh=LFxwe/fYzrJm7ooMwcuVu91PvpUukue37wGQYKio/rc=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=llBN91/pbOA4GOosROGW2aRdzOUR+dkDubHBllZooudT2MNq8pfIlgHUegkYicqv44/uoUppwAuze1/Mp2yuykruwLHdlAwIZjHrvBAdGm/W3KkOKWaYqDxBzqCPzflAz9PShZodhiKJRqLiVehCe7XrkRkRTyZV6KENzwemVOE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fwd79.aul.t-online.de (fwd79.aul.t-online.de [10.223.144.105]) by mailout09.t-online.de (Postfix) with SMTP id 590765468F for ; Mon, 23 Oct 2023 15:28:21 +0200 (CEST) Received: from localhost.localdomain ([115.165.108.210]) by fwd79.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1quuyh-1gsmYq0; Mon, 23 Oct 2023 15:28:20 +0200 Message-ID: Subject: [SH][committed] Fix PR 111001 From: Oleg Endo To: gcc-patches Date: Mon, 23 Oct 2023 22:28:15 +0900 User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1698067700-41561D4D-DE4E0309/0/0 CLEAN NORMAL X-TOI-MSGID: efb01a28-f891-45e5-b0dc-976e8639e323 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780553066208431201 X-GMAIL-MSGID: 1780553066208431201 The attached patch fixes PR 111001. Committed to master, cherry-picked to GCC-13, GCC-12 and GCC-11. Sanity tested with 'make all-gcc'. Bootstrapped on GCC-13 sh4-linux by Adrian. Cheers, Oleg gcc/ChangeLog: PR target/111001 * config/sh/sh_treg_combine.cc (sh_treg_combine::record_set_of_reg): Skip over nop move insns. From 4414818f4e5de54ea3c353e2ebb2e79a89ae211b Mon Sep 17 00:00:00 2001 From: Oleg Endo Date: Mon, 23 Oct 2023 22:08:37 +0900 Subject: [PATCH] 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. --- 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 f6553c0..685ca54 100644 --- a/gcc/config/sh/sh_treg_combine.cc +++ b/gcc/config/sh/sh_treg_combine.cc @@ -731,9 +731,16 @@ sh_treg_combine::record_set_of_reg (rtx reg, rtx_insn *start_insn, new_entry.cstore_type = cstore_inverted; } 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; -- libgit2 1.3.2