public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] rtl-ssa: Don't leave NOTE_INSN_DELETED around
@ 2023-10-30 18:34 Jeff Law
0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-10-30 18:34 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4a7a597e6c40d1a19e1a9b718e612cd7815236aa
commit 4a7a597e6c40d1a19e1a9b718e612cd7815236aa
Author: Alex Coplan <alex.coplan@arm.com>
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.
(cherry picked from commit e90c7bd520545b31fee687aab58cb4b258d1db16)
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 3e5451390e2a..aab532b9f260 100644
--- a/gcc/rtl-ssa/changes.cc
+++ b/gcc/rtl-ssa/changes.cc
@@ -765,7 +765,11 @@ function_info::change_insns (array_slice<insn_change *> 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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-30 18:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-30 18:34 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] rtl-ssa: Don't leave NOTE_INSN_DELETED around Jeff Law
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).