This is the mail archive of the gcc-bugs@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]

[Bug other/20565] New: gcov default behaviour changed


In gcov/g++ 3.3, if I compile with "g++ test.cc -ftest-coverage -fprofile-arcs",
and then run "gcov test.cc", "test.cc.gcov" contains 2 lines of preamble, and
then 1 line for each line of test.cc

in gcov/g++ 4.1, Extra lines are added. I can't seem to disable these, and I'm
not positive why they are there. In particular they confuse programs which use
the output of "gcov"..

Specific example:
Given temp.cc:
template <typename T>
int
foo(T t)
{
  if(t==1)
    return 1;
  else
    return 0;
}


int main(void)
{ foo(1); }

Then "g++-3.3 temp.cc -ftest-coverage -fprofile-arcs; ./a.out ; gcov-3.3
temp.cc" gives

        -:    0:Source:temp.cc
        -:    0:Object:temp.bb
        -:    1:template <typename T>
        -:    2:int
        -:    3:foo(T t)
        -:    4:{
        1:    5:  if(t==1)
        1:    6:    return 1;
        -:    7:  else
    #####:    8:    return 0;
        -:    9:}
        -:   10:
        -:   11:
        -:   12:int main(void)
        2:   13:{ foo(1); }


Whereas "g++-cvs temp.cc -ftest-coverage -fprofile-arcs ; ./a.out ; gcov-cvs
temp.cc" gives

        -:    0:Source:temp.cc
        -:    0:Graph:temp.gcno
        -:    0:Data:temp.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:template <typename T>
        -:    2:int
function _Z3fooIiEiT_ called 1 returned 100% blocks executed 75%
        1:    3:foo(T t)
        -:    4:{
        1:    5:  if(t==1)
        1:    6:    return 1;
        -:    7:  else
    #####:    8:    return 0;
        -:    9:}
        -:   10:
        -:   11:
function main called 1 returned 100% blocks executed 100%
        1:   12:int main(void)
        1:   13:{ foo(1); }


Is it possible to turn this off? Is it a regression?

-- 
           Summary: gcov default behaviour changed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris at bubblescope dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20565


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