OSDN Git Service

* gcse.c (insert_store): Fix typo in previous patch.
[pf3gnuchains/gcc-fork.git] / gcc / loop-init.c
index 44b9d61..13285a3 100644 (file)
@@ -27,18 +27,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "basic-block.h"
 #include "cfgloop.h"
 #include "cfglayout.h"
-#include "gcov-io.h"
-#include "profile.h"
 
 /* Initialize loop optimizer.  */
 
 struct loops *
-loop_optimizer_init (dumpfile)
-     FILE *dumpfile;
+loop_optimizer_init (FILE *dumpfile)
 {
   struct loops *loops = xcalloc (1, sizeof (struct loops));
   edge e;
 
+  /* Initialize structures for layout changes.  */
+  cfg_layout_initialize ();
+
   /* Avoid annoying special cases of edges going to exit
      block.  */
   for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
@@ -49,9 +49,16 @@ loop_optimizer_init (dumpfile)
 
   if (flow_loops_find (loops, LOOP_TREE) <= 1)
     {
+      basic_block bb;
+
       /* No loops.  */
       flow_loops_free (loops);
       free (loops);
+      /* Make chain.  */
+      FOR_EACH_BB (bb)
+       if (bb->next_bb != EXIT_BLOCK_PTR)
+         bb->rbi->next = bb->next_bb;
+         cfg_layout_finalize ();
       return NULL;
     }
 
@@ -61,11 +68,8 @@ loop_optimizer_init (dumpfile)
   free (loops->cfg.dfs_order);
   loops->cfg.dfs_order = NULL;
 
-  /* Initialize structures for layout changes.  */
-  cfg_layout_initialize (loops);
-
   /* Create pre-headers.  */
-  create_preheaders (loops, CP_SIMPLE_PREHEADERS | CP_INSIDE_CFGLAYOUT);
+  create_preheaders (loops, CP_SIMPLE_PREHEADERS);
 
   /* Force all latches to have only single successor.  */
   force_single_succ_latches (loops);
@@ -86,9 +90,7 @@ loop_optimizer_init (dumpfile)
 
 /* Finalize loop optimizer.  */
 void
-loop_optimizer_finalize (loops, dumpfile)
-     struct loops *loops;
-     FILE *dumpfile;
+loop_optimizer_finalize (struct loops *loops, FILE *dumpfile)
 {
   basic_block bb;
 
@@ -96,7 +98,7 @@ loop_optimizer_finalize (loops, dumpfile)
   /* Make chain.  */
   FOR_EACH_BB (bb)
     if (bb->next_bb != EXIT_BLOCK_PTR)
-      RBI (bb)->next = bb->next_bb;
+      bb->rbi->next = bb->next_bb;
 
   /* Another dump.  */
   flow_loops_dump (loops, dumpfile, NULL, 1);
@@ -104,7 +106,7 @@ loop_optimizer_finalize (loops, dumpfile)
   /* Clean up.  */
   flow_loops_free (loops);
   free (loops);
+
   /* Finalize changes.  */
   cfg_layout_finalize ();
 
@@ -113,4 +115,3 @@ loop_optimizer_finalize (loops, dumpfile)
   verify_flow_info ();
 #endif
 }
-