OSDN Git Service

Removed as part of irix config changes.
[pf3gnuchains/gcc-fork.git] / gcc / cfgloop.c
index 7709a03..58d9dd0 100644 (file)
@@ -97,11 +97,12 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file)
 bool
 flow_loop_nested_p (const struct loop *outer, const struct loop *loop)
 {
-  return loop->depth > outer->depth
-        && loop->pred[outer->depth] == outer;
+  return (loop->depth > outer->depth
+        && loop->pred[outer->depth] == outer);
 }
 
-/* Returns superloop of LOOP at given DEPTH.  */
+/* Returns the loop such that LOOP is nested DEPTH (indexed from zero)
+   loops within LOOP.  */
 
 struct loop *
 superloop_at_depth (struct loop *loop, unsigned depth)
@@ -574,6 +575,7 @@ update_latch_info (basic_block jump)
   HEADER_BLOCK (jump) = 0;
   alloc_aux_for_edge (jump->pred, sizeof (int));
   LATCH_EDGE (jump->pred) = 0;
+  set_immediate_dominator (CDI_DOMINATORS, jump, jump->pred->src);
 }
 
 /* A callback for make_forwarder block, to redirect all edges except for
@@ -605,9 +607,6 @@ canonicalize_loop_headers (void)
   basic_block header;
   edge e;
 
-  /* Compute the dominators.  */
-  calculate_dominance_info (CDI_DOMINATORS);
-
   alloc_aux_for_blocks (sizeof (int));
   alloc_aux_for_edges (sizeof (int));
 
@@ -637,8 +636,6 @@ canonicalize_loop_headers (void)
        HEADER_BLOCK (header) = num_latches;
     }
 
-  free_dominance_info (CDI_DOMINATORS);
-
   if (HEADER_BLOCK (ENTRY_BLOCK_PTR->succ->dest))
     {
       basic_block bb;
@@ -710,6 +707,10 @@ canonicalize_loop_headers (void)
 
   free_aux_for_blocks ();
   free_aux_for_edges ();
+
+#ifdef ENABLE_CHECKING
+  verify_dominators (CDI_DOMINATORS);
+#endif
 }
 
 /* Find all the natural loops in the function and save in LOOPS structure and
@@ -746,12 +747,12 @@ flow_loops_find (struct loops *loops, int flags)
   dfs_order = NULL;
   rc_order = NULL;
 
+  /* Ensure that the dominators are computed.  */
+  calculate_dominance_info (CDI_DOMINATORS);
+
   /* Join loops with shared headers.  */
   canonicalize_loop_headers ();
 
-  /* Compute the dominators.  */
-  calculate_dominance_info (CDI_DOMINATORS);
-
   /* Count the number of loop headers.  This should be the
      same as the number of natural loops.  */
   headers = sbitmap_alloc (last_basic_block);
@@ -879,10 +880,6 @@ flow_loops_find (struct loops *loops, int flags)
 
       loops->num = num_loops;
     }
-  else
-    {
-      free_dominance_info (CDI_DOMINATORS);
-    }
 
   sbitmap_free (headers);