OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / cfgcleanup.c
index 67ddfa9..338281a 100644 (file)
@@ -33,6 +33,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "rtl.h"
 #include "hard-reg-set.h"
 #include "basic-block.h"
@@ -261,7 +263,7 @@ mentions_nonequal_regs (x, data)
   return 0;
 }
 /* Attempt to prove that the basic block B will have no side effects and
-   allways continues in the same edge if reached via E.  Return the edge
+   always continues in the same edge if reached via E.  Return the edge
    if exist, NULL otherwise.  */
 
 static edge
@@ -321,7 +323,7 @@ thread_jump (mode, e, b)
     return NULL;
 
   /* Ensure that the comparison operators are equivalent.
-     ??? This is far too pesimistic.  We should allow swapped operands,
+     ??? This is far too pessimistic.  We should allow swapped operands,
      different CCmodes, or for example comparisons for interval, that
      dominate even when operands are not equivalent.  */
   if (!rtx_equal_p (XEXP (cond1, 0), XEXP (cond2, 0))
@@ -1117,9 +1119,11 @@ outgoing_edges_match (mode, bb1, bb2)
   /* If BB1 has only one successor, we may be looking at either an
      unconditional jump, or a fake edge to exit.  */
   if (bb1->succ && !bb1->succ->succ_next
-      && !(bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)))
+      && (bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0
+      && (GET_CODE (bb1->end) != JUMP_INSN || simplejump_p (bb1->end)))
     return (bb2->succ &&  !bb2->succ->succ_next
-           && (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0);
+           && (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0
+           && (GET_CODE (bb2->end) != JUMP_INSN || simplejump_p (bb2->end)));
 
   /* Match conditional jumps - this may get tricky when fallthru and branch
      edges are crossed.  */
@@ -1141,17 +1145,6 @@ outgoing_edges_match (mode, bb1, bb2)
          || !onlyjump_p (bb2->end))
        return false;
 
-      /* Do not crossjump across loop boundaries.  This is a temporary
-        workaround for the common scenario in which crossjumping results
-        in killing the duplicated loop condition, making bb-reorder rotate
-        the loop incorectly, leaving an extra unconditional jump inside
-        the loop.
-
-        This check should go away once bb-reorder knows how to duplicate
-        code in this case or rotate the loops to avoid this scenario.  */
-      if (bb1->loop_depth != bb2->loop_depth)
-       return false;
-
       b1 = BRANCH_EDGE (bb1);
       b2 = BRANCH_EDGE (bb2);
       f1 = FALLTHRU_EDGE (bb1);
@@ -1774,7 +1767,7 @@ cleanup_cfg (mode)
     {
       changed = true;
       /* We've possibly created trivially dead code.  Cleanup it right
-        now to introduce more oppurtunities for try_optimize_cfg.  */
+        now to introduce more opportunities for try_optimize_cfg.  */
       if (!(mode & (CLEANUP_NO_INSN_DEL
                    | CLEANUP_UPDATE_LIFE | CLEANUP_PRE_SIBCALL))
          && !reload_completed)
@@ -1788,8 +1781,8 @@ cleanup_cfg (mode)
       delete_unreachable_blocks (), changed = true;
       if (mode & CLEANUP_UPDATE_LIFE)
        {
-         /* Cleaning up CFG introduces more oppurtunities for dead code
-            removal that in turn may introduce more oppurtunities for
+         /* Cleaning up CFG introduces more opportunities for dead code
+            removal that in turn may introduce more opportunities for
             cleaning up the CFG.  */
          if (!update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
                                                 PROP_DEATH_NOTES