]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns if one of block...
authorJan Hubicka <jh@suse.cz>
Thu, 20 Dec 2001 17:01:26 +0000 (18:01 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 20 Dec 2001 17:01:26 +0000 (17:01 +0000)
* cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns
if one of block does not contain jump.
(outgoing_edge_math): Revert last path; require edges to be noncomplex
nonfake to match single exit edge; require conditional jumps to not
have side effect.

From-SVN: r48203

gcc/ChangeLog
gcc/cfgcleanup.c

index f2e40d126e746b5a949795d99b21ae0914da9ca8..7ed306ee27ea63031667daafd0e5fc3053415b2a 100644 (file)
@@ -1,3 +1,11 @@
+Thu Dec 20 16:58:46 CET 2001  Jan Hubicka  <jh@suse.cz>
+
+       * cfgcleanup.c (flow_find_cross_jump): Avoid incrementing of ninsns
+       if one of block does not contain jump.
+       (outgoing_edge_math): Revert last path; require edges to be noncomplex
+       nonfake to match single exit edge; require conditional jumps to not
+       have side effect.
+
 2001-12-20  Turly O'Connor  <turly@apple.com>
 
        * tm.texi (ASM_OUTPUT_OPERAND): Change documentation references to
index b23def8b3bc328ffe2f1ca3d39df88d81beafea8..abb0217711c624de913782e9d2887051291cf21b 100644 (file)
@@ -855,9 +855,6 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2)
       || (returnjump_p (i1) && !side_effects_p (PATTERN (i1))))
     {
       last1 = i1;
-      /* Count everything except for unconditional jump as insn.  */
-      if (!simplejump_p (i1) && !returnjump_p (i1))
-       ninsns++;
       i1 = PREV_INSN (i1);
     }
   i2 = bb2->end;
@@ -865,6 +862,9 @@ flow_find_cross_jump (mode, bb1, bb2, f1, f2)
       || (returnjump_p (i2) && !side_effects_p (PATTERN (i2))))
     {
       last2 = i2;
+      /* Count everything except for unconditional jump as insn.  */
+      if (!simplejump_p (i2) && !returnjump_p (i2) && last1)
+       ninsns++;
       i2 = PREV_INSN (i2);
     }
 
@@ -958,11 +958,13 @@ 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)
+  if (bb1->succ && !bb1->succ->succ_next
+      && !(bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)))
     {
-      if (! bb2->succ || bb2->succ->succ_next)
+      if (! bb2->succ || bb2->succ->succ_next
+         || (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)))
        return false;
-      return insns_match_p (mode, bb1->end, bb2->end);
+      return true;
     }
 
   /* Match conditional jumps - this may get tricky when fallthru and branch
@@ -970,7 +972,8 @@ outgoing_edges_match (mode, bb1, bb2)
   if (bb1->succ
       && bb1->succ->succ_next
       && !bb1->succ->succ_next->succ_next
-      && any_condjump_p (bb1->end))
+      && any_condjump_p (bb1->end)
+      && onlyjump_p (bb1->end))
     {
       edge b1, f1, b2, f2;
       bool reverse, match;
@@ -980,7 +983,8 @@ outgoing_edges_match (mode, bb1, bb2)
       if (!bb2->succ
           || !bb2->succ->succ_next
          || bb1->succ->succ_next->succ_next
-         || !any_condjump_p (bb2->end))
+         || !any_condjump_p (bb2->end)
+         || !onlyjump_p (bb1->end))
        return false;
 
       b1 = BRANCH_EDGE (bb1);