diff options
author | Teresa Johnson <tejohnson@google.com> | 2013-08-29 13:51:04 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@gcc.gnu.org> | 2013-08-29 13:51:04 +0000 |
commit | 103ff0d65e9033a2fdf05b4f4c9b7686d95e78c0 (patch) | |
tree | fc61cacb307eeb74176a0b795fc6db1199798047 /gcc/coverage.c | |
parent | 301bbc16628d9ca57cd7b0af306fde6753f04911 (diff) | |
download | gcc-103ff0d65e9033a2fdf05b4f4c9b7686d95e78c0.zip gcc-103ff0d65e9033a2fdf05b4f4c9b7686d95e78c0.tar.gz gcc-103ff0d65e9033a2fdf05b4f4c9b7686d95e78c0.tar.bz2 |
dumpfile.c (dump_loc): Output column number.
2013-08-29 Teresa Johnson <tejohnson@google.com>
* dumpfile.c (dump_loc): Output column number.
* dumpfile.h (OPTGROUP_OTHER): Add and enable under OPTGROUP_ALL.
* doc/invoke.texi: Document optall -fopt-info flag.
* profile.c (read_profile_edge_counts): Use new dump framework.
(compute_branch_probabilities): Ditto.
* passes.c (pass_manager::register_one_dump_file): Use OPTGROUP_OTHER
when pass not in any opt group.
* pass_manager.h (pass_manager::get_pass_profile): New method.
* value-prof.c (check_counter): Use new dump framework.
(check_ic_target): Ditto.
* coverage.c (get_coverage_counts): Ditto.
(coverage_init): Setup new dump framework.
* testsuite/gcc.dg/pr40209.c: Use -fopt-info.
* testsuite/gcc.dg/pr26570.c: Ditto.
* testsuite/gcc.dg/pr32773.c: Ditto.
* testsuite/g++.dg/tree-ssa/dom-invalid.C: Ditto.
* testsuite/gcc.dg/inline-dump.c: New test.
From-SVN: r202077
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r-- | gcc/coverage.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c index 9b664cf..d662e8d 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -43,6 +43,9 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "hash-table.h" #include "tree-iterator.h" +#include "context.h" +#include "pass_manager.h" +#include "tree-pass.h" #include "cgraph.h" #include "dumpfile.h" #include "diagnostic-core.h" @@ -341,11 +344,13 @@ get_coverage_counts (unsigned counter, unsigned expected, { static int warned = 0; - if (!warned++) - inform (input_location, (flag_guess_branch_prob - ? "file %s not found, execution counts estimated" - : "file %s not found, execution counts assumed to be zero"), - da_file_name); + if (!warned++ && dump_enabled_p ()) + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location, + (flag_guess_branch_prob + ? "file %s not found, execution counts estimated" + : "file %s not found, execution counts assumed to " + "be zero"), + da_file_name); return NULL; } @@ -369,21 +374,25 @@ get_coverage_counts (unsigned counter, unsigned expected, warning_at (input_location, OPT_Wcoverage_mismatch, "the control flow of function %qE does not match " "its profile data (counter %qs)", id, ctr_names[counter]); - if (warning_printed) + if (warning_printed && dump_enabled_p ()) { - inform (input_location, "use -Wno-error=coverage-mismatch to tolerate " - "the mismatch but performance may drop if the function is hot"); + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location, + "use -Wno-error=coverage-mismatch to tolerate " + "the mismatch but performance may drop if the " + "function is hot"); if (!seen_error () && !warned++) { - inform (input_location, "coverage mismatch ignored"); - inform (input_location, flag_guess_branch_prob - ? G_("execution counts estimated") - : G_("execution counts assumed to be zero")); + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location, + "coverage mismatch ignored"); + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location, + flag_guess_branch_prob + ? G_("execution counts estimated") + : G_("execution counts assumed to be zero")); if (!flag_guess_branch_prob) - inform (input_location, - "this can result in poorly optimized code"); + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, input_location, + "this can result in poorly optimized code"); } } @@ -1125,6 +1134,11 @@ coverage_init (const char *filename) int len = strlen (filename); int prefix_len = 0; + /* Since coverage_init is invoked very early, before the pass + manager, we need to set up the dumping explicitly. This is + similar to the handling in finish_optimization_passes. */ + dump_start (g->get_passes ()->get_pass_profile ()->static_pass_number, NULL); + if (!profile_data_prefix && !IS_ABSOLUTE_PATH (filename)) profile_data_prefix = getpwd (); @@ -1167,6 +1181,8 @@ coverage_init (const char *filename) gcov_write_unsigned (bbg_file_stamp); } } + + dump_finish (g->get_passes ()->get_pass_profile ()->static_pass_number); } /* Performs file-level cleanup. Close notes file, generate coverage |