]> gcc.gnu.org Git - gcc.git/commitdiff
rtl-ssa: Fix handling of deleted insns
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 24 Oct 2023 10:30:52 +0000 (11:30 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 24 Oct 2023 10:30:52 +0000 (11:30 +0100)
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.

gcc/rtl-ssa/changes.cc

index 73ab3ccfd242245c9278df39aeed13fde3912c54..de6222ae736b989b2ec4cee8543de12b488b0074 100644 (file)
@@ -983,7 +983,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)
            {
This page took 0.073345 seconds and 5 git commands to generate.