diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-29 00:34:09 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-29 00:34:09 +0000 |
commit | 4e8871a04f4928e8a6d833c78b060e20af6b4e12 (patch) | |
tree | 66950d896c4e79e9db825a8c670c14a160a7f554 /gcc/tree-optimize.c | |
parent | a0e2666d3dddd50253c1384c234f5815ca62aa88 (diff) | |
download | ppe42-gcc-4e8871a04f4928e8a6d833c78b060e20af6b4e12.tar.gz ppe42-gcc-4e8871a04f4928e8a6d833c78b060e20af6b4e12.zip |
PR c++/12850
* cgraph.c (cgraph_remove_node): Clear out saved/insns/arguments and
initial pointers.
* cgraphunit.c (cgraph_finalize_function): Clear out DECL_SAVED_INSNS
for functions that will be only inlined.
(cgraph_mark_function_to_output): Likewise.
(cgraph_expand_function): Sanity check that DECL_DEFER_OUTPUT is clear;
do not clear function body.
* tree-optimize.c (clear_decl_rtl): Use decl_function_context.
(tree_rest_of_compilation): Reorganize the logic releasing function
body to use callgraph datastructure.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76822 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r-- | gcc/tree-optimize.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index f1957ab20e7..e42fa06ef56 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -65,13 +65,13 @@ clear_decl_rtl (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, void *data) { case VAR_DECL: nonstatic_p = !TREE_STATIC (t) && !DECL_EXTERNAL (t); - local_p = DECL_CONTEXT (t) == data; + local_p = decl_function_context (t) == data; break; case PARM_DECL: case LABEL_DECL: nonstatic_p = true; - local_p = DECL_CONTEXT (t) == data; + local_p = decl_function_context (t) == data; break; case RESULT_DECL: @@ -205,18 +205,22 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) walk_tree_without_duplicates (&DECL_SAVED_TREE (fndecl), clear_decl_rtl, fndecl); - - if (DECL_SAVED_INSNS (fndecl) == 0 && !nested_p && !flag_inline_trees) + if (!cgraph_function_possibly_inlined_p (fndecl)) { - /* 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. */ - if (DECL_INITIAL (fndecl) != 0) - DECL_INITIAL (fndecl) = error_mark_node; - - DECL_ARGUMENTS (fndecl) = 0; + DECL_SAVED_TREE (fndecl) = NULL; + if (DECL_SAVED_INSNS (fndecl) == 0 + && !cgraph_node (fndecl)->origin) + { + /* 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. */ + if (DECL_INITIAL (fndecl) != 0) + DECL_INITIAL (fndecl) = error_mark_node; + + DECL_ARGUMENTS (fndecl) = 0; + } } input_location = saved_loc; |