diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-20 20:38:29 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-20 20:38:29 +0000 |
commit | 9d95b2b0274da8229a9c7961422e0f7d44d714fd (patch) | |
tree | 25c6e4482c10189121acfa2bf0f54130a9876b63 /gcc/cgraphunit.c | |
parent | b71b0310532ccb4edefc4326ed8ff7d945b57df4 (diff) | |
download | gcc-9d95b2b0274da8229a9c7961422e0f7d44d714fd.tar.gz |
PR middle-end/16460
* cgraph.c (cgraph_unnest_node): New function.
(c_finalize): Rename to ....
(c_warn_unused_result_recursivly): ... this one; do only the warning
(finish_function): Finalize the toplevel function; do not lower nested tree.
* cgraph.h (cgraph_unnest_node): Declare.
* cgraphunit.c (decide_is_function_needed): Do not use cgraph
nestedness datastructure.
* cse.c (cse_insn): Do not cprop nonlocal LABEL_REFs.
* reload1.c (set_label_offsets): Fix call of set_label_offsets.
* tree-nested.c (finlize_nesting_tree_1): Use un-nesting code.
* utils.c (gnat_finalize): Remove.
(end_subprog_body): Directly call cgraph_finalize_function;
do not lower the nested functions.
* trans-decl.c (build_entry_thunks): Finalize the function; do not lower
tree.
(gfc_generate_function_code): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87770 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index e4348ca8b83..7da68540108 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -263,7 +263,7 @@ static tree memory_identifier; static bool decide_is_function_needed (struct cgraph_node *node, tree decl) { - struct cgraph_node *origin; + tree origin; /* If we decided it was needed before, but at the time we didn't have the body of the function available, then it's still needed. We have @@ -303,8 +303,9 @@ decide_is_function_needed (struct cgraph_node *node, tree decl) return false; /* Nested functions of extern inline function shall not be emit unless we inlined the origin. */ - for (origin = node->origin; origin; origin = origin->origin) - if (DECL_EXTERNAL (origin->decl)) + for (origin = decl_function_context (decl); origin; + origin = decl_function_context (origin)) + if (DECL_EXTERNAL (origin)) return false; /* We want to emit COMDAT functions only when absolutely necessary. */ if (DECL_COMDAT (decl)) @@ -586,6 +587,9 @@ cgraph_finalize_function (tree decl, bool nested) notice_global_symbol (decl); node->decl = decl; node->local.finalized = true; + if (node->nested) + lower_nested_functions (decl); + gcc_assert (!node->nested); /* If not unit at a time, then we need to create the call graph now, so that called functions can be queued and emitted now. */ |