[PATCH] Don't error on coverage mismatch by request

Richard Guenther richard.guenther@gmail.com
Mon Jan 22 13:42:00 GMT 2007


On 1/22/07, Jan Hubicka <jh@suse.cz> wrote:
> > On 1/14/07, Jan Hubicka <hubicka@ucw.cz> wrote:
> > >> On 1/14/07, Manuel López-Ibá?ez <lopezibanez@gmail.com> wrote:
> > >> >I ain't no diagnostics maintainer but, don't we need a few testcases
> > >> >for this? Like, testing for not enabled by default and testing with
> > >> >the option enabled? Or that rule only applies for newbies like me?
> > >>
> > >> It's hard to do a testcase for this with current dejagnu setup, but in
> > >> principle
> > >> you are right.
> > >
> > >You can most probably use the tree-profile testcase and different -D
> > >switch for profiling and feedback run.
> >
> > Do you know how I can do this?  There seems to be no generate/use
> > special dg-options.
>
> What about simply hacking tree-prof.exp to always pass -DPROFILE_GENERATE
> along with -fprofile-generate and -DPROFILE_USE with -fprofile-use?
> Testcases supposed to pass won't use it.

Ok, with this I managed to create a testcase that checks for properly
not-erroring.
But only with providing '-w' and silencing the extra inform () calls
in coverage.c
for inbibit_warnings==1.  As we do not support dg-error or dg-warning
for tree-prof.exp,
nor do we support an XFAIL somewhere (so I could declare profile
mismatch without
-Wcoverage-mismatch xfail...)

Maybe better than nothing?

Richard.

2007-01-20  Richard Guenther  <rguenther@suse.de>

        * doc/invoke.texi (-Wcoverage-mismatch): Document.
        * common.opt (-Wcoverage-mismatch): New warning option.
        * coverage.c (get_coverage_counts): Ignore coverage mismatch
        if -Wcoverage-mismatch is given.

        * gcc.dg/tree-prof/tree-prof.exp: Define _PROFILE_GENERATE
        and _PROFILE_USE.
        * gcc.dg/tree-prof/wcoverage-mismatch-1.c: New failing testcase.
        * gcc.dg/tree-prof/wcoverage-mismatch-2.c: New testcase.


More information about the Gcc-patches mailing list