OSDN Git Service

2004-10-02 James A. Morrison <phython@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree-optimize.c
index 9a18f37..1d145dc 100644 (file)
@@ -391,7 +391,9 @@ init_tree_optimization_passes (void)
   p = &pass_loop.sub;
   NEXT_PASS (pass_loop_init);
   NEXT_PASS (pass_lim);
+  NEXT_PASS (pass_unswitch);
   NEXT_PASS (pass_iv_canon);
+  NEXT_PASS (pass_record_bounds);
   NEXT_PASS (pass_if_conversion);
   NEXT_PASS (pass_vectorize);
   NEXT_PASS (pass_linear_transform);
@@ -553,7 +555,7 @@ update_inlined_to_pointers (struct cgraph_node *node,
       if (e->callee->global.inlined_to)
        {
          e->callee->global.inlined_to = inlined_to;
-         update_inlined_to_pointers (e->callee, node);
+         update_inlined_to_pointers (e->callee, inlined_to);
        }
     }
 }
@@ -563,7 +565,7 @@ update_inlined_to_pointers (struct cgraph_node *node,
    compilation for FNDECL.  */
 
 void
-tree_rest_of_compilation (tree fndecl, bool nested_p)
+tree_rest_of_compilation (tree fndecl)
 {
   location_t saved_loc;
   struct cgraph_node *saved_node = NULL, *node;
@@ -627,11 +629,6 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
   if (!vars_to_rename)
     vars_to_rename = BITMAP_XMALLOC ();
 
-  /* If this is a nested function, protect the local variables in the stack
-     above us from being collected while we're compiling this function.  */
-  if (nested_p)
-    ggc_push_context ();
-
   /* Perform all tree transforms and optimizations.  */
   execute_pass_list (all_passes);
 
@@ -648,20 +645,14 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
       if (!flag_unit_at_a_time)
        {
          struct cgraph_edge *e;
-         verify_cgraph ();
+
          while (node->callees)
            cgraph_remove_edge (node->callees);
          node->callees = saved_node->callees;
          saved_node->callees = NULL;
+         update_inlined_to_pointers (node, node);
          for (e = node->callees; e; e = e->next_callee)
-           {
-             if (e->callee->global.inlined_to)
-               {
-                 e->callee->global.inlined_to = node;
-                 update_inlined_to_pointers (e->callee, node);
-               }
-             e->caller = node;
-           }
+           e->caller = node;
          cgraph_remove_node (saved_node);
        }
     }
@@ -693,7 +684,7 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
        }
     }
 
-  if (!nested_p && !flag_inline_trees)
+  if (!flag_inline_trees)
     {
       DECL_SAVED_TREE (fndecl) = NULL;
       if (DECL_STRUCT_FUNCTION (fndecl) == 0
@@ -712,9 +703,5 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
   input_location = saved_loc;
 
   ggc_collect ();
-
-  /* Undo the GC context switch.  */
-  if (nested_p)
-    ggc_pop_context ();
   timevar_pop (TV_EXPAND);
 }