bb-reorder.c (make_reorder_chain_1): Handle case where jump edge goes to the same...
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Wed, 24 Jan 2001 05:57:46 +0000 (05:57 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 24 Jan 2001 05:57:46 +0000 (22:57 -0700)
        * bb-reorder.c (make_reorder_chain_1): Handle case where
        jump edge goes to the same block as the fallthru edge.

From-SVN: r39228

gcc/ChangeLog
gcc/bb-reorder.c

index ee6029b7e98c1a6edcd41685ed0bf42835126b28..7c1958cd33d42a470c36b58104d165ebcf6373e0 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-23  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * bb-reorder.c (make_reorder_chain_1): Handle case where
+       jump edge goes to the same block as the fallthru edge.
 2001-01-23  Jim Wilson  <wilson@redhat.com>
 
        * dwarf2out.c (dwarf2out_line): Make last_file_num be unsigned.
index 9b8a1bd17e65479069cad1688142ac25b2cd00a7..08d23264632b039904b91d2eb1400f4258859a51 100644 (file)
@@ -397,14 +397,25 @@ make_reorder_chain_1 (bb, prev)
 
       /* Find the normal taken edge and the normal fallthru edge.
          Note that there may in fact be other edges due to
-        asynchronous_exceptions.  */
+        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;
     }