aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 80041ec..7c55c8a 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -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,