OSDN Git Service

* gcc.c-torture/compile/20021120-1.c: New test.
[pf3gnuchains/gcc-fork.git] / gcc / bb-reorder.c
index 8ad50e1..24c41e5 100644 (file)
@@ -122,9 +122,9 @@ make_reorder_chain ()
            next = bb;
            break;
          }
-      
+
       if (next)
-        prev = make_reorder_chain_1 (next, prev);
+       prev = make_reorder_chain_1 (next, prev);
     }
   while (next);
   RBI (prev)->next = NULL;
@@ -209,17 +209,21 @@ make_reorder_chain_1 (bb, prev)
   /* In the absence of a prediction, disturb things as little as possible
      by selecting the old "next" block from the list of successors.  If
      there had been a fallthru edge, that will be the one.  */
+  /* Note that the fallthru block may not be next any time we eliminate
+     forwarder blocks.  */
   if (! next)
     {
       for (e = bb->succ; e ; e = e->succ_next)
-       if (e->dest == bb->next_bb)
+       if (e->flags & EDGE_FALLTHRU)
          {
-           if ((e->flags & EDGE_FALLTHRU)
-               || (e->dest->succ
-                   && ! (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH))))
-             next = e->dest;
+           next = e->dest;
            break;
          }
+       else if (e->dest == bb->next_bb)
+         {
+           if (! (e->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)))
+             next = e->dest;
+         }
     }
 
   /* Make sure we didn't select a silly next block.  */