public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] rtl-ssa: Fix handling of deleted insns
@ 2023-10-30 18:33 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-10-30 18:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7e12375faa7546db2abd655193082e5207734c8c

commit 7e12375faa7546db2abd655193082e5207734c8c
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Tue Oct 24 11:30:52 2023 +0100

    rtl-ssa: Fix handling of deleted insns
    
    RTL-SSA queues up some invasive changes for later.  But sometimes
    the insns involved in those changes can be deleted by later
    optimisations, making the queued change unnecessary.  This patch
    checks for that case.
    
    gcc/
            * rtl-ssa/changes.cc (function_info::perform_pending_updates): Check
            whether an insn has been replaced by a note.
    
    (cherry picked from commit c97b167e35774e5add4d1079b552383d3fea62dc)

Diff:
---
 gcc/rtl-ssa/changes.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/rtl-ssa/changes.cc b/gcc/rtl-ssa/changes.cc
index c48ddd2463cd..37fb9ce625aa 100644
--- a/gcc/rtl-ssa/changes.cc
+++ b/gcc/rtl-ssa/changes.cc
@@ -954,7 +954,10 @@ function_info::perform_pending_updates ()
   for (insn_info *insn : m_queued_insn_updates)
     {
       rtx_insn *rtl = insn->rtl ();
-      if (JUMP_P (rtl))
+      if (NOTE_P (rtl))
+	// The insn was later optimized away, typically to a NOTE_INSN_DELETED.
+	;
+      else if (JUMP_P (rtl))
 	{
 	  if (INSN_CODE (rtl) == NOOP_MOVE_INSN_CODE)
 	    {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-30 18:33 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:33 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] rtl-ssa: Fix handling of deleted insns 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).