aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-12-05 09:34:06 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-12-05 09:34:06 +0000
commit68fbd81bf093b2c14f94666153ca6428ac237880 (patch)
tree9c39d5d8b0db4235403b46001e26f3ccf5695b33 /gcc
parent03a6c305d3003e6aafbf014bf2c6651839fa7400 (diff)
downloadgcc-68fbd81bf093b2c14f94666153ca6428ac237880.zip
gcc-68fbd81bf093b2c14f94666153ca6428ac237880.tar.gz
gcc-68fbd81bf093b2c14f94666153ca6428ac237880.tar.bz2
passes.c (pass_init_dump_file): Only open a clean graph dump file if the dump was not already initialized.
* passes.c (pass_init_dump_file): Only open a clean graph dump file if the dump was not already initialized. Revert: 2012-12-03 Steven Bosscher <steven@gcc.gnu.org> * passes.c (finish_optimization_passes): Don't finish graph dumps here. (pass_fini_dump_file): Wrap in TV_DUMP. Finish graph dumps. (execute_one_pass): Don't set up graph dumps here. From-SVN: r194186
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/passes.c23
2 files changed, 29 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8a8bb9e..5bbe08b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2012-12-05 Steven Bosscher <steven@gcc.gnu.org>
+
+ * passes.c (pass_init_dump_file): Only open a clean graph dump file if
+ the dump was not already initialized.
+
+ Revert:
+ 2012-12-03 Steven Bosscher <steven@gcc.gnu.org>
+ * passes.c (finish_optimization_passes): Don't finish graph dumps here.
+ (pass_fini_dump_file): Wrap in TV_DUMP. Finish graph dumps.
+ (execute_one_pass): Don't set up graph dumps here.
+
2012-12-05 Richard Biener <rguenther@suse.de>
PR lto/55525
diff --git a/gcc/passes.c b/gcc/passes.c
index b2c4c17..92b78b6 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -223,6 +223,10 @@ rest_of_type_compilation (tree type, int toplev)
void
finish_optimization_passes (void)
{
+ int i;
+ struct dump_file_info *dfi;
+ char *name;
+
timevar_push (TV_DUMP);
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{
@@ -230,12 +234,24 @@ finish_optimization_passes (void)
end_branch_prob ();
dump_finish (pass_profile.pass.static_pass_number);
}
+
if (optimize > 0)
{
dump_start (pass_profile.pass.static_pass_number, NULL);
print_combine_total_stats ();
dump_finish (pass_profile.pass.static_pass_number);
}
+
+ /* Do whatever is necessary to finish printing the graphs. */
+ for (i = TDI_end; (dfi = get_dump_file_info (i)) != NULL; ++i)
+ if (dump_initialized_p (i)
+ && (dfi->pflags & TDF_GRAPH) != 0
+ && (name = get_dump_file_name (i)) != NULL)
+ {
+ finish_graph_dump_file (name);
+ free (name);
+ }
+
timevar_pop (TV_DUMP);
}
@@ -2058,7 +2074,8 @@ pass_init_dump_file (struct opt_pass *pass)
dump_start (pass->static_pass_number, &dump_flags);
if (dump_file && current_function_decl)
dump_function_header (dump_file, current_function_decl, dump_flags);
- if (dump_file && (dump_flags & TDF_GRAPH)
+ if (initializing_dump
+ && dump_file && (dump_flags & TDF_GRAPH)
&& cfun && (cfun->curr_properties & PROP_cfg))
clean_graph_dump_file (dump_file_name);
timevar_pop (TV_DUMP);
@@ -2079,10 +2096,6 @@ pass_fini_dump_file (struct opt_pass *pass)
/* Flush and close dump file. */
if (dump_file_name)
{
- gcc_assert (dump_file);
- if (dump_flags & TDF_GRAPH
- && cfun && (cfun->curr_properties & PROP_cfg))
- finish_graph_dump_file (dump_file_name);
free (CONST_CAST (char *, dump_file_name));
dump_file_name = NULL;
}