From: vries Date: Tue, 15 Mar 2016 11:51:32 +0000 (+0000) Subject: Fix fdump-ipa-all-graph X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9e9225bfe54fb97ebacc41762a0fdbffbb4688c;p=thirdparty%2Fgcc.git Fix fdump-ipa-all-graph 2016-03-15 Tom de Vries PR ipa/70161 * cgraph.c (cgraph_node::get_body): Save, reset and restore dump_file_name. * passes.c (execute_one_ipa_transform_pass): Add missing argument to execute_function_dump. (execute_one_pass): Don't dump function if it will be dumped after ipa transform. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234211 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 637ef039cd87..3b4bdd408451 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-03-15 Tom de Vries + + PR ipa/70161 + * cgraph.c (cgraph_node::get_body): Save, reset and restore + dump_file_name. + * passes.c (execute_one_ipa_transform_pass): Add missing argument to + execute_function_dump. + (execute_one_pass): Don't dump function if it will be dumped after ipa + transform. + 2016-03-15 Segher Boessenkool * genrecog.c (match_pattern_2): If pred is NULL don't call diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 871ed62fd615..518ef24c54d1 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -3369,7 +3369,9 @@ cgraph_node::get_body (void) { opt_pass *saved_current_pass = current_pass; FILE *saved_dump_file = dump_file; + const char *saved_dump_file_name = dump_file_name; int saved_dump_flags = dump_flags; + dump_file_name = NULL; push_cfun (DECL_STRUCT_FUNCTION (decl)); execute_all_ipa_transforms (); @@ -3381,6 +3383,7 @@ cgraph_node::get_body (void) current_pass = saved_current_pass; dump_file = saved_dump_file; + dump_file_name = saved_dump_file_name; dump_flags = saved_dump_flags; } return updated; diff --git a/gcc/passes.c b/gcc/passes.c index 1bf89edc9217..9d9025116f46 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -2214,7 +2214,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node, check_profile_consistency (pass->static_pass_number, 1, true); if (dump_file) - do_per_function (execute_function_dump, NULL); + do_per_function (execute_function_dump, pass); pass_fini_dump_file (pass); current_pass = NULL; @@ -2351,15 +2351,15 @@ execute_one_pass (opt_pass *pass) check_profile_consistency (pass->static_pass_number, 1, true); verify_interpass_invariants (); - if (dump_file) - do_per_function (execute_function_dump, pass); - if (pass->type == IPA_PASS) + if (pass->type == IPA_PASS + && ((ipa_opt_pass_d *)pass)->function_transform) { struct cgraph_node *node; - if (((ipa_opt_pass_d *)pass)->function_transform) - FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) - node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass); + FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) + node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass); } + else if (dump_file) + do_per_function (execute_function_dump, pass); if (!current_function_decl) symtab->process_new_functions ();