Le 28/02/2025 à 17:01, Filip Kastl a écrit :
diff --git a/gcc/gimple-ssa-sccopy.cc b/gcc/gimple-ssa-sccopy.cc
index 9f25fbaff36..7ffb5718ab6 100644
--- a/gcc/gimple-ssa-sccopy.cc
+++ b/gcc/gimple-ssa-sccopy.cc
@@ -568,6 +568,19 @@ scc_copy_prop::propagate ()
      {
        vec<gimple *> scc = worklist.pop ();
+ /* When we do 'replace_scc_by_value' it may happen that some EH edges
+        get removed.  That means parts of CFG get removed.  Those may
+        contain copy statements.  For that reason we prune SCCs here.  */
+      unsigned i;
+      for (i = 0; i < scc.length (); i++)
+       if (gimple_bb (scc[i]) == NULL)
+         scc.unordered_remove (i);
Hello,
this may not be important, but don't you need to skip the increment of i if the item is removed?
     for (i = 0; i < scc.length ();)
        if (gimple_bb (scc[i]) == NULL)
          scc.unordered_remove (i);
        else
          i++;

Mikael

Reply via email to