From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7810) id 9FF4D3858D35; Fri, 20 Oct 2023 10:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FF4D3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697798847; bh=M8jHMZ9+NvPiRugWDHgKuzJneCx81t5uXNcyfFD+IdE=; h=From:To:Subject:Date:From; b=KorwbCoMvBEbdlqBSfSll5YQfl4Vo7lq1EgMhP7/1vqY2/G78QqMBwnUln+94VQz/ OG7SJuZ9IFABhFBz0pivquArXZOAgcNcb934FxkbpZJuynhFupCgaaKGGVWO9QYNbd zvQ012h/wa3PYulWzk8OESo0cZN9RH/G4SPoVvXA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Alex Coplan To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4784] rtl-ssa: Don't leave NOTE_INSN_DELETED around X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/heads/master X-Git-Oldrev: d6add7aa903726a9dcca1242cf16a94dcccb53d9 X-Git-Newrev: e90c7bd520545b31fee687aab58cb4b258d1db16 Message-Id: <20231020104727.9FF4D3858D35@sourceware.org> Date: Fri, 20 Oct 2023 10:47:27 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e90c7bd520545b31fee687aab58cb4b258d1db16 commit r14-4784-ge90c7bd520545b31fee687aab58cb4b258d1db16 Author: Alex Coplan Date: Fri Oct 20 11:46:27 2023 +0100 rtl-ssa: Don't leave NOTE_INSN_DELETED around This patch tweaks change_insns to also call ::remove_insn to ensure the underlying RTL insn gets removed from the insn chain in the case of a deletion. This avoids leaving NOTE_INSN_DELETED around after deleting insns. For movement, the RTL insn chain is updated earlier in change_insns with the call to move_insn. For deletion, it seems reasonable to do it here. gcc/ChangeLog: * rtl-ssa/changes.cc (function_info::change_insns): Ensure we call ::remove_insn on deleted insns. Diff: --- gcc/rtl-ssa/changes.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rtl-ssa/changes.cc b/gcc/rtl-ssa/changes.cc index 523ad60d7d89..73ab3ccfd242 100644 --- a/gcc/rtl-ssa/changes.cc +++ b/gcc/rtl-ssa/changes.cc @@ -706,7 +706,11 @@ function_info::change_insns (array_slice changes) insn_change &change = *changes[i]; insn_info *insn = change.insn (); if (change.is_deletion ()) - remove_insn (insn); + { + if (rtx_insn *rtl = insn->rtl ()) + ::remove_insn (rtl); // Remove the underlying RTL insn. + remove_insn (insn); + } else if (insn_info *placeholder = placeholders[i]) { // Check if earlier movements turned a move into a no-op.