This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Disable early inlining while compiling for coverage (issue5173042)


> Yes, this will improve test coverage option's usability, but please
> provide the example to explain the issues.
> 
> David
> 
> On Fri, Sep 30, 2011 at 6:12 PM, Sharad Singhai <singhai@google.com> wrote:
> > This patch disables early inlining when --coverage option is
> > specified. This improves coverage data in presence of other
> > optimizations, specially with -O2 where early inlining changes the
> > control flow graph sufficiently enough to generate seemingly very odd
> > source coverage.

BTW early inlining was introduced to make coverage possible on some C++
sources, like tramp3d ;) However the problem here is that since we moved
coverage to SSA, we do it too late.  My longer term plan is to separate
coverage and profile feedback passes (so they can't be done both together) and
instrument early for coverage & ensure that everything before coverage is done
is save WRT line info. Inlining alone does not mess up the line info, but most
optimizations we have in early optimization queue do.

We discussed it back when Richi implemented SSA profiling but we didn't do that
basically due to lack of testcases.  Would be possible to take one you have
and fill in some PRs? Those are regressions WRT pre-SSA profiling releases (I think 4.5?)

Honza
> >
> > Bootstrapped okay and regression tests passed.
> >
> > Okay for google/gcc-4_6?
> >
> > 2011-09-30 ? Sharad Singhai ?<singhai@google.com>
> >
> > ? ? ? ?* gcc.c (cc1_options): Added -fno-early-inlining for coverage.
> >
> > Index: gcc.c
> > ===================================================================
> > --- gcc.c ? ? ? (revision 179402)
> > +++ gcc.c ? ? ? (working copy)
> > @@ -776,7 +776,7 @@
> > ?%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
> > ?%{fsyntax-only:-o %j} %{-param*}\
> > ?%{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
> > - %{coverage:-fprofile-arcs -ftest-coverage}";
> > + %{coverage:-fprofile-arcs -ftest-coverage -fno-early-inlining}";
> >
> > ?/* If an assembler wrapper is used to invoke post-assembly tools
> > ? ?like MAO, --save-temps need to be passed to save the output of
> >
> > --
> > This patch is available for review at http://codereview.appspot.com/5173042
> >


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]