cfgcleanup.c (try_crossjump_to_edge): Always split SRC2 if it has EH predecessor...
authorSteven Bosscher <stevenb@suse.de>
Sun, 27 Nov 2005 12:42:33 +0000 (12:42 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Sun, 27 Nov 2005 12:42:33 +0000 (12:42 +0000)
        * cfgcleanup.c (try_crossjump_to_edge): Always split SRC2 if it
        has EH predecessor edges.

From-SVN: r107565

gcc/ChangeLog
gcc/cfgcleanup.c

index c343af9e1b056536523efc779159cce729939fbc..a5b33e6fd70de3646e0bfa1693e4ad71f37f273b 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-27  Steven Bosscher  <stevenb@suse.de>
+
+       * cfgcleanup.c (try_crossjump_to_edge): Always split SRC2 if it
+       has EH predecessor edges.
+
 2005-11-26  Eric Christopher  <echristo@apple.com>
 
        * config/i386/i386.md (*zero_extendqihi2_movzbw): Avoid partial
index 66a0dec648862d5418da46f2c70d2aa6b96d48ce..7e3cb0ec76876faafd621e3307ad3f6df967897a 100644 (file)
@@ -1572,11 +1572,23 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
        }
     }
 
-  /* Avoid splitting if possible.  */
-  if (newpos2 == BB_HEAD (src2))
+  /* Avoid splitting if possible.  We must always split when SRC2 has
+     EH predecessor edges, or we may end up with basic blocks with both
+     normal and EH predecessor edges.  */
+  if (newpos2 == BB_HEAD (src2)
+      && !(EDGE_PRED (src2, 0)->flags & EDGE_EH))
     redirect_to = src2;
   else
     {
+      if (newpos2 == BB_HEAD (src2))
+       {
+         /* Skip possible basic block header.  */
+         if (LABEL_P (newpos2))
+           newpos2 = NEXT_INSN (newpos2);
+         if (NOTE_P (newpos2))
+           newpos2 = NEXT_INSN (newpos2);
+       }
+
       if (dump_file)
        fprintf (dump_file, "Splitting bb %i before %i insns\n",
                 src2->index, nmatch);