[PATCH] PR86957

Martin Liška mliska@suse.cz
Tue Sep 11 09:23:00 GMT 2018


On 09/05/2018 09:28 PM, Indu Bhagat wrote:
> Patch for PR 86957 " gcc should warn about missing profiles for a compilation unit or a new function with -fprofile-use".
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86957
> 
> The patch adds -Wmissing-profile warning flag to alert user about cases when there is no profile data for a compilation unit or a function when using -fprofile-use.
> 
> The flag is on by default when -fprofile-use is specified and generates errors
> by default (like -Wcoverage-mismatch).
> 
> The attachment pr86957-missing-profile-diagnostic shows the behavior of GCC with the patch.
> 
> Thanks
> Indu
> 
> ------------------------------------------------------
> 
> 
> gcc/ChangeLog:
> 
> 2018-09-05  "Indu Bhagat"  <"indu.bhagat@oracle.com">
> 
>         * common.opt: New warning option -Wmissing-profile.
>         * coverage.c (get_coverage_counts): Add warning for missing .gcda file.
>         * doc/invoke.texi: Document -Wmissing-profile.
>         * profile.c (get_exec_counts): Add warning for missing feedback
>           profile for a function.
>         * toplev.c (process_options): -Wmissing-profile warning as error.
> 

... and please add a test-case for the missing file. That's easy to achieve by running
a test-case with -fprofile-use.

Martin



More information about the Gcc-patches mailing list