===================================================================
@@ -472,9 +472,10 @@
: DECL_SOURCE_LOCATION (current_function_decl);
if (flag_profile_correction)
{
- inform (locus, "correcting inconsistent value profile: "
- "%s profiler overall count (%d) does not match BB count "
- "(%d)", name, (int)*all, (int)bb_count);
+ if (flag_profile_use_verbose)
+ inform (locus, "correcting inconsistent value profile: %s "
+ "profiler overall count (%d) does not match BB count "
+ "(%d)", name, (int)*all, (int)bb_count);
*all = bb_count;
if (*count > *all)
*count = *all;
@@ -510,33 +511,42 @@
location_t locus;
if (*count1 > all && flag_profile_correction)
{
- locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- inform (locus, "Correcting inconsistent value profile: "
- "ic (topn) profiler top target count (%ld) exceeds "
- "BB count (%ld)", (long)*count1, (long)all);
+ if (flag_profile_use_verbose)
+ {
+ locus = (stmt != NULL)
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ inform (locus, "Correcting inconsistent value profile: "
+ "ic (topn) profiler top target count (%ld) exceeds "
+ "BB count (%ld)", (long)*count1, (long)all);
+ }
*count1 = all;
}
if (*count2 > all && flag_profile_correction)
{
- locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- inform (locus, "Correcting inconsistent value profile: "
- "ic (topn) profiler second target count (%ld) exceeds "
- "BB count (%ld)", (long)*count2, (long)all);
+ if (flag_profile_use_verbose)
+ {
+ locus = (stmt != NULL)
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ inform (locus, "Correcting inconsistent value profile: "
+ "ic (topn) profiler second target count (%ld) exceeds "
+ "BB count (%ld)", (long)*count2, (long)all);
+ }
*count2 = all;
}
if (*count2 > *count1)
{
- locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- inform (locus, "Corrupted topn ic value profile: "
- "first target count (%ld) is less than the second "
- "target count (%ld)", (long)*count1, (long)*count2);
+ if (flag_profile_use_verbose)
+ {
+ locus = (stmt != NULL)
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ inform (locus, "Corrupted topn ic value profile: "
+ "first target count (%ld) is less than the second "
+ "target count (%ld)", (long)*count1, (long)*count2);
+ }
return true;
}
@@ -548,12 +558,16 @@
*count2 = all - *count1;
else
{
- locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- inform (locus, "Corrupted topn ic value profile: top two targets's"
- " total count (%ld) exceeds bb count (%ld)",
- (long)(*count1 + *count2), (long)all);
+ if (flag_profile_use_verbose)
+ {
+ locus = (stmt != NULL)
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ inform (locus,
+ "Corrupted topn ic value profile: top two targets's"
+ " total count (%ld) exceeds bb count (%ld)",
+ (long)(*count1 + *count2), (long)all);
+ }
return true;
}
}
@@ -1177,8 +1191,11 @@
func_id) == NULL)
{
if (flag_profile_correction)
- inform (DECL_SOURCE_LOCATION (current_function_decl),
+ {
+ if (flag_profile_use_verbose)
+ inform (DECL_SOURCE_LOCATION (current_function_decl),
"Inconsistent profile: indirect call target (%d) does
not exist", func_id);
+ }
else
error ("Inconsistent profile: indirect call target (%d) does
not exist", func_id);
@@ -1308,8 +1325,9 @@
return true;
locus = gimple_location (call_stmt);
- inform (locus, "Skipping target %s with mismatching types for icall ",
- cgraph_node_name (target));
+ if (flag_profile_use_verbose)
+ inform (locus, "Skipping target %s with mismatching types for icall ",
+ cgraph_node_name (target));
return false;
}
===================================================================
@@ -1442,7 +1442,8 @@
if (iteration > MAX_ITER (fixup_graph->num_vertices,
fixup_graph->num_edges))
{
- inform (DECL_SOURCE_LOCATION (current_function_decl),
+ if (flag_profile_use_verbose)
+ inform (DECL_SOURCE_LOCATION (current_function_decl),
"Exiting profile correction early to avoid excessive "
"compile time");
break;
===================================================================
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-use" } */
-/* { dg-options "-O -m4 -fprofile-use" { target sh-*-* } } */
+/* { dg-options "-O -fprofile-use -fprofile-use-verbose" } */
+/* { dg-options "-O -m4 -fprofile-use -fprofile-use-verbose" { target
sh-*-* } } */
void foo (int *p)
{
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fprofile-use" } */
+/* { dg-options "-O2 -fprofile-use -fprofile-use-verbose" } */
void process(const char *s);
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fprofile-generate -fprofile-use" } */
+/* { dg-options "-O2 -fprofile-generate -fprofile-use
-fprofile-use-verbose" } */
unsigned test (unsigned a, unsigned b)
{
===================================================================
@@ -1,7 +1,7 @@
// PR tree-optimization/39557
// invalid post-dom info leads to infinite loop
// { dg-do run }
-// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use -fno-rtti" }
+// { dg-options "-Wall -fno-exceptions -O2 -fprofile-use
-fprofile-use-verbose -fno-rtti" }
struct C
{
===================================================================
@@ -414,7 +414,7 @@
if (flag_profile_correction)
{
static bool informed = 0;
- if (!informed)
+ if (flag_profile_use_verbose && !informed)
inform (input_location,
"corrupted profile info: edge count
exceeds maximal count");
informed = 1;
@@ -635,7 +635,7 @@
{
/* Inconsistency detected. Make it flow-consistent. */
static int informed = 0;
- if (informed == 0)
+ if (flag_profile_use_verbose && informed == 0)
{
informed = 1;
inform (input_location, "correcting inconsistent profile data");
===================================================================
@@ -575,29 +575,47 @@
int fd;
char *aux_da_filename = get_da_file_name (mod_info->da_filename);
gcc_assert (!mod_info->is_primary);
- if (pointer_set_insert (modset, (void *)(size_t)mod_info->ident))
- inform (input_location, "Not importing %s: already imported",
- mod_info->source_filename);
- else if ((module_infos[0]->lang & GCOV_MODULE_LANG_MASK) !=
- (mod_info->lang & GCOV_MODULE_LANG_MASK))
- inform (input_location, "Not importing %s: source language"
- " different from primary module's source language",
- mod_info->source_filename);
- else if (module_infos_read == max_group)
- inform (input_location, "Not importing %s: maximum group size"
- " reached", mod_info->source_filename);
- else if (incompatible_cl_args (module_infos[0], mod_info))
- inform (input_location, "Not importing %s: command-line"
- " arguments not compatible with primary module",
- mod_info->source_filename);
- else if ((fd = open (aux_da_filename, O_RDONLY)) < 0)
- inform (input_location, "Not importing %s: couldn't open %s",
- mod_info->source_filename, aux_da_filename);
- else if ((mod_info->lang & GCOV_MODULE_ASM_STMTS)
- && flag_ripa_disallow_asm_modules)
- inform (input_location, "Not importing %s: contains assembler"
- " statements", mod_info->source_filename);
- else
+ if (pointer_set_insert (modset, (void *)(size_t)mod_info->ident))
+ {
+ if (flag_ripa_verbose)
+ inform (input_location, "Not importing %s:
already imported",
+ mod_info->source_filename);
+ }
+ else if ((module_infos[0]->lang & GCOV_MODULE_LANG_MASK) !=
+ (mod_info->lang & GCOV_MODULE_LANG_MASK))
+ {
+ if (flag_ripa_verbose)
+ inform (input_location, "Not importing %s: source language"
+ " different from primary module's source language",
+ mod_info->source_filename);
+ }
+ else if (module_infos_read == max_group)
+ {
+ if (flag_ripa_verbose)
+ inform (input_location, "Not importing %s: maximum group"
+ " size reached", mod_info->source_filename);
+ }
+ else if (incompatible_cl_args (module_infos[0], mod_info))
+ {
+ if (flag_ripa_verbose)
+ inform (input_location, "Not importing %s: command-line"
+ " arguments not compatible with primary module",
+ mod_info->source_filename);
+ }
+ else if ((fd = open (aux_da_filename, O_RDONLY)) < 0)
+ {
+ if (flag_ripa_verbose)
+ inform (input_location, "Not importing %s:
couldn't open %s",
+ mod_info->source_filename, aux_da_filename);
+ }
+ else if ((mod_info->lang & GCOV_MODULE_ASM_STMTS)
+ && flag_ripa_disallow_asm_modules)
+ {
+ if (flag_ripa_verbose)
+ inform (input_location, "Not importing %s: contains "
+ "assembler statements", mod_info->source_filename);
+ }
+ else
{
close (fd);
module_infos_read++;
@@ -676,7 +694,7 @@
{
static int warned = 0;
- if (!warned++)
+ if (flag_profile_use_verbose && !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"),
@@ -689,7 +707,8 @@
if (!entry)
{
if (!flag_dyn_ipa)
- warning (0, "no coverage for function %qE found",
+ warning (OPT_Wcoverage_mismatch,
+ "no coverage for function %qE found",
DECL_ASSEMBLER_NAME (current_function_decl));
return NULL;
}
@@ -705,7 +724,7 @@
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 (flag_profile_use_verbose && warning_printed)
{
inform (input_location, "Use -Wno-error=coverage-mismatch to tolerate "
"the mismatch but performance may drop if the function is hot");
@@ -727,7 +746,8 @@
}
else if (entry->lineno_checksum != lineno_checksum)
{
- warning (0, "Source location for function %qE have changed,"
+ warning (OPT_Wcoverage_mismatch,
+ "Source location for function %qE have changed,"
" the profile data may be out of date",
DECL_ASSEMBLER_NAME (current_function_decl));
}
===================================================================
@@ -1697,6 +1697,10 @@
Common Joined RejectNegative
Enable common options for performing profile feedback directed
optimizations, and set -fprofile-dir=
+fprofile-use-verbose
+Common Report Var(flag_profile_use_verbose)
+Enable verbose informational messages for FDO use compilation
+
fprofile-values
Common Report Var(flag_profile_values)
Insert code to profile values of expressions
===================================================================
@@ -1096,13 +1096,16 @@
reusedist_make_instr_call (stmt, subst, counters),
GSI_NEW_STMT);
- locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- inform (locus,
- "inserted reuse distance instrumentation for %qs, using "
- "%d gcov counters", subst->original_name,
- subst->num_ptr_args * RD_NUM_COUNTERS);
+ if (flag_profile_use_verbose)
+ {
+ locus = (stmt != NULL)
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ inform (locus,
+ "inserted reuse distance instrumentation for
%qs, using "
+ "%d gcov counters", subst->original_name,
+ subst->num_ptr_args * RD_NUM_COUNTERS);
+ }
}
}