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:
Martin Liska 2016-03-31 12:42:55 +02:00 committed by Martin Liska
parent 515558b8ff
commit d4aff57bc0
2 changed files with 32 additions and 17 deletions

View File

@ -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.

View File

@ -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 ();