summaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-04 23:04:18 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-04 23:04:18 +0000
commitd85a20139d881d9d1adab64ffc7305cb3ae98e2a (patch)
tree0f4ef35ecb306a63e1426bcc2ec3b362210eccfe /gcc/coverage.c
parent4d4ec3c86cac3f21e5908f762285a995b69dd4e2 (diff)
parent7d500d30a2205a6e6e6783a4b92cc38d66f3b70b (diff)
downloadgcc-d85a20139d881d9d1adab64ffc7305cb3ae98e2a.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r--gcc/coverage.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index efe3998701b..87384673a89 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