aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 19ae876..05713c2 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -673,9 +673,8 @@ cgraph_node::analyze (void)
/* Lower the function. */
if (!lowered)
{
- if (nested)
+ if (first_nested_function (this))
lower_nested_functions (decl);
- gcc_assert (!nested);
gimple_register_cfg_hooks ();
bitmap_obstack_initialize (NULL);
@@ -2343,14 +2342,11 @@ cgraph_node::expand (void)
}
gimple_set_body (decl, NULL);
- if (DECL_STRUCT_FUNCTION (decl) == 0
- && !cgraph_node::get (decl)->origin)
+ if (DECL_STRUCT_FUNCTION (decl) == 0)
{
/* Stop pointing to the local nodes about to be freed.
But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition.
- For a nested function, this is done in c_pop_function_context.
- If rest_of_compilation set this to 0, leave it 0. */
+ was an actual function definition. */
if (DECL_INITIAL (decl) != 0)
DECL_INITIAL (decl) = error_mark_node;
}
@@ -3001,6 +2997,9 @@ symbol_table::finalize_compilation_unit (void)
/* Gimplify and lower thunks. */
analyze_functions (/*first_time=*/false);
+ /* All nested functions should be lowered now. */
+ nested_function_info::release ();
+
/* Offloading requires LTO infrastructure. */
if (!in_lto_p && g->have_offload)
flag_generate_offload = 1;