OSDN Git Service

* simplify-rtx.c (simplify_subreg): Fix verification of
[pf3gnuchains/gcc-fork.git] / gcc / bb-reorder.c
index 45b5f2f..e13e5f1 100644 (file)
 #include "flags.h"
 #include "output.h"
 #include "function.h"
-#include "except.h"
 #include "toplev.h"
 #include "recog.h"
-#include "insn-flags.h"
 #include "expr.h"
 #include "obstack.h"
 
@@ -396,15 +394,24 @@ make_reorder_chain_1 (bb, prev)
       taken = probability > REG_BR_PROB_BASE / 2;
 
       /* Find the normal taken edge and the normal fallthru edge.
-         Note that there may in fact be other edges due to
-        asynchronous_exceptions.  */
+
+        Note, conditional jumps with other side effects may not
+        be fully optimized.  In this case it is possible for
+        the conditional jump to branch to the same location as
+        the fallthru path.
+
+        We should probably work to improve optimization of that
+        case; however, it seems silly not to also deal with such
+        problems here if they happen to occur.  */
 
       e_taken = e_fall = NULL;
       for (e = bb->succ; e ; e = e->succ_next)
-       if (e->flags & EDGE_FALLTHRU)
-         e_fall = e;
-       else if (! (e->flags & EDGE_EH))
-         e_taken = e;
+       {
+         if (e->flags & EDGE_FALLTHRU)
+           e_fall = e;
+         if (! (e->flags & EDGE_EH))
+           e_taken = e;
+       }
 
       next = (taken ? e_taken : e_fall)->dest;
     }
@@ -1346,17 +1353,6 @@ reorder_basic_blocks ()
   if (n_basic_blocks <= 1)
     return;
 
-  /* We do not currently handle correct re-placement of EH notes.
-     But that does not matter unless we intend to use them.  */
-  if (flag_exceptions && ! exceptions_via_longjmp)
-    for (i = 0; i < n_basic_blocks; i++)
-      {
-       edge e;
-       for (e = BASIC_BLOCK (i)->succ; e ; e = e->succ_next)
-         if (e->flags & EDGE_EH)
-           return;
-      }
-
   for (i = 0; i < n_basic_blocks; i++)
     BASIC_BLOCK (i)->aux = xcalloc (1, sizeof (struct reorder_block_def));