]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cfgrtl.c (purge_dead_edges): Correct handling of EDGE_EH.
authorMark Mitchell <mark@codesourcery.com>
Thu, 16 May 2002 17:00:56 +0000 (17:00 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 16 May 2002 17:00:56 +0000 (17:00 +0000)
From-SVN: r53520

gcc/ChangeLog
gcc/cfgrtl.c

index 58c163b4685b4149fa5b1dd6301c31b566ae0069..266de27de673a572a6f308f68bc8df3308c2b222 100644 (file)
@@ -1,3 +1,7 @@
+2002-05-16  Mark Mitchell  <mark@codesourcery.com>
+
+       * cfgrtl.c (purge_dead_edges): Correct handling of EDGE_EH.
+
 2002-05-09  David S. Miller  <davem@redhat.com>
 
        * config/sparc/sol2.h (ASM_CPU_SPEC): Handle -mcpu=v9.
index 5e8bde24838380703f190d7098a22be6c6bf2421..e57c88a7b5bc567271bf910409147e36686b161f 100644 (file)
@@ -1954,17 +1954,26 @@ purge_dead_edges (bb)
  
          e->flags &= ~EDGE_ABNORMAL;
 
-         /* Check purposes we can have edge.  */
-         if ((e->flags & EDGE_FALLTHRU)
-             && any_condjump_p (insn))
+         /* See if this edge is one we should keep.  */
+         if ((e->flags & EDGE_FALLTHRU) && any_condjump_p (insn))
+           /* A conditional jump can fall through into the next
+              block, so we should keep the edge.  */
            continue;
          else if (e->dest != EXIT_BLOCK_PTR
                   && e->dest->head == JUMP_LABEL (insn))
+           /* If the destination block is the target of the jump,
+              keep the edge.  */
+           continue;
+         else if (e->dest == EXIT_BLOCK_PTR && returnjump_p (insn))
+           /* If the destination block is the exit block, and this
+              instruction is a return, then keep the edge.  */
            continue;
-         else if (e->dest == EXIT_BLOCK_PTR
-                  && returnjump_p (insn))
+         else if ((e->flags & EDGE_EH) && can_throw_internal (insn))
+           /* Keep the edges that correspond to exceptions thrown by
+              this instruction.  */
            continue;
 
+         /* We do not need this edge.  */
          purged = true;
          remove_edge (e);
        }