Commit 5a15be97 by Tom de Vries Committed by Tom de Vries

Fix fdump-ipa-all-graph

2016-03-15  Tom de Vries  <tom@codesourcery.com>

	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.

From-SVN: r234211
parent 3ea33585
2016-03-15 Tom de Vries <tom@codesourcery.com>
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 <segher@kernel.crashing.org> 2016-03-15 Segher Boessenkool <segher@kernel.crashing.org>
* genrecog.c (match_pattern_2): If pred is NULL don't call * genrecog.c (match_pattern_2): If pred is NULL don't call
......
...@@ -3369,7 +3369,9 @@ cgraph_node::get_body (void) ...@@ -3369,7 +3369,9 @@ cgraph_node::get_body (void)
{ {
opt_pass *saved_current_pass = current_pass; opt_pass *saved_current_pass = current_pass;
FILE *saved_dump_file = dump_file; FILE *saved_dump_file = dump_file;
const char *saved_dump_file_name = dump_file_name;
int saved_dump_flags = dump_flags; int saved_dump_flags = dump_flags;
dump_file_name = NULL;
push_cfun (DECL_STRUCT_FUNCTION (decl)); push_cfun (DECL_STRUCT_FUNCTION (decl));
execute_all_ipa_transforms (); execute_all_ipa_transforms ();
...@@ -3381,6 +3383,7 @@ cgraph_node::get_body (void) ...@@ -3381,6 +3383,7 @@ cgraph_node::get_body (void)
current_pass = saved_current_pass; current_pass = saved_current_pass;
dump_file = saved_dump_file; dump_file = saved_dump_file;
dump_file_name = saved_dump_file_name;
dump_flags = saved_dump_flags; dump_flags = saved_dump_flags;
} }
return updated; return updated;
......
...@@ -2214,7 +2214,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node, ...@@ -2214,7 +2214,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
check_profile_consistency (pass->static_pass_number, 1, true); check_profile_consistency (pass->static_pass_number, 1, true);
if (dump_file) if (dump_file)
do_per_function (execute_function_dump, NULL); do_per_function (execute_function_dump, pass);
pass_fini_dump_file (pass); pass_fini_dump_file (pass);
current_pass = NULL; current_pass = NULL;
...@@ -2351,15 +2351,15 @@ execute_one_pass (opt_pass *pass) ...@@ -2351,15 +2351,15 @@ execute_one_pass (opt_pass *pass)
check_profile_consistency (pass->static_pass_number, 1, true); check_profile_consistency (pass->static_pass_number, 1, true);
verify_interpass_invariants (); verify_interpass_invariants ();
if (dump_file) if (pass->type == IPA_PASS
do_per_function (execute_function_dump, pass); && ((ipa_opt_pass_d *)pass)->function_transform)
if (pass->type == IPA_PASS)
{ {
struct cgraph_node *node; struct cgraph_node *node;
if (((ipa_opt_pass_d *)pass)->function_transform)
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
node->ipa_transforms_to_apply.safe_push ((ipa_opt_pass_d *)pass); 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) if (!current_function_decl)
symtab->process_new_functions (); symtab->process_new_functions ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment