Thanks for the reviews. I have incorporated all but one (See below; its the change in the warning's brief summary in common.opt) in the patch. In this patch, 1. -Wmissing-profile is a warning by default and is ON by default with -fprofile-use 2. Attached pr86957-missing-profile-diagnostic-2 shows the warning messages 3. Added a testcase for warning in the case of missing profile feedback data file for a compilation unit Thanks gcc/ChangeLog: 2018-09-14 "Indu Bhagat" * common.opt: New warning option -Wmissing-profile. * coverage.c (get_coverage_counts): Add warning for missing .gcda file. * doc/invoke.texi: Document -Wmissing-profile. gcc/testsuite/ChangeLog: 2018-09-14 "Indu Bhagat" * gcc.dg/Wmissing-profile.c: New test. On 09/11/2018 02:21 AM, Martin Liška wrote: >> diff --git a/gcc/common.opt b/gcc/common.opt >> index ebc3ef4..d93ddca 100644 >> --- a/gcc/common.opt >> +++ b/gcc/common.opt >> @@ -811,6 +811,10 @@ Wcoverage-mismatch >> Common Var(warn_coverage_mismatch) Init(1) Warning >> Warn in case profiles in -fprofile-use do not match. >> >> +Wmissing-profile >> +Common Var(warn_missing_profile) Init(1) Warning >> +Warn in case profiles in -fprofile-use do not exist. > Maybe 'Want about missing profile for a function in -fprofile-use build.' ? > Since, Wmissing-profile also warns when feedback data file is missing for a compilation unit, the suggested text above will be more restrictive. So I did not change.