OSDN Git Service

2009-07-17 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / tree-nested.c
index 80041ec..7c55c8a 100644 (file)
@@ -2443,6 +2443,17 @@ free_nesting_tree (struct nesting_info *root)
   while (root);
 }
 
+/* Gimplify a function and all its nested functions.  */
+static void
+gimplify_all_functions (struct cgraph_node *root)
+{
+  struct cgraph_node *iter;
+  if (!gimple_body (root->decl))
+    gimplify_function_tree (root->decl);
+  for (iter = root->nested; iter; iter = iter->next_nested)
+    gimplify_all_functions (iter);
+}
+
 /* Main entry point for this pass.  Process FNDECL and all of its nested
    subroutines and turn them into something less tightly bound.  */
 
@@ -2457,6 +2468,8 @@ lower_nested_functions (tree fndecl)
   if (!cgn->nested)
     return;
 
+  gimplify_all_functions (cgn);
+
   bitmap_obstack_initialize (&nesting_info_bitmap_obstack);
   root = create_nesting_tree (cgn);
   walk_all_functions (convert_nonlocal_reference_stmt,