mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-21 17:21:03 +08:00
Do not call todo_after for a discarded function
* passes.c (execute_one_pass): Do not call todo_after for a discarded function. From-SVN: r234613
This commit is contained in:
parent
515558b8ff
commit
d4aff57bc0
@ -1,3 +1,8 @@
|
||||
2016-03-31 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* passes.c (execute_one_pass): Do not call
|
||||
todo_after for a discarded function.
|
||||
|
||||
2016-03-31 Bin Cheng <bin.cheng@arm.com>
|
||||
|
||||
* tree-ssa-loop-ivopts.c (struct comp_cost): New scrach field.
|
||||
|
44
gcc/passes.c
44
gcc/passes.c
@ -2334,6 +2334,33 @@ execute_one_pass (opt_pass *pass)
|
||||
|
||||
/* Do it! */
|
||||
todo_after = pass->execute (cfun);
|
||||
|
||||
if (todo_after & TODO_discard_function)
|
||||
{
|
||||
pass_fini_dump_file (pass);
|
||||
|
||||
gcc_assert (cfun);
|
||||
/* As cgraph_node::release_body expects release dominators info,
|
||||
we have to release it. */
|
||||
if (dom_info_available_p (CDI_DOMINATORS))
|
||||
free_dominance_info (CDI_DOMINATORS);
|
||||
|
||||
if (dom_info_available_p (CDI_POST_DOMINATORS))
|
||||
free_dominance_info (CDI_POST_DOMINATORS);
|
||||
|
||||
tree fn = cfun->decl;
|
||||
pop_cfun ();
|
||||
gcc_assert (!cfun);
|
||||
cgraph_node::get (fn)->release_body ();
|
||||
|
||||
current_pass = NULL;
|
||||
redirect_edge_var_map_empty ();
|
||||
|
||||
ggc_collect ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
do_per_function (clear_last_verified, NULL);
|
||||
|
||||
/* Stop timevar. */
|
||||
@ -2373,23 +2400,6 @@ execute_one_pass (opt_pass *pass)
|
||||
current_pass = NULL;
|
||||
redirect_edge_var_map_empty ();
|
||||
|
||||
if (todo_after & TODO_discard_function)
|
||||
{
|
||||
gcc_assert (cfun);
|
||||
/* As cgraph_node::release_body expects release dominators info,
|
||||
we have to release it. */
|
||||
if (dom_info_available_p (CDI_DOMINATORS))
|
||||
free_dominance_info (CDI_DOMINATORS);
|
||||
|
||||
if (dom_info_available_p (CDI_POST_DOMINATORS))
|
||||
free_dominance_info (CDI_POST_DOMINATORS);
|
||||
|
||||
tree fn = cfun->decl;
|
||||
pop_cfun ();
|
||||
gcc_assert (!cfun);
|
||||
cgraph_node::get (fn)->release_body ();
|
||||
}
|
||||
|
||||
/* Signal this is a suitable GC collection point. */
|
||||
if (!((todo_after | pass->todo_flags_finish) & TODO_do_not_ggc_collect))
|
||||
ggc_collect ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user