Bug 20566 - gcov default behaviour changed
Summary: gcov default behaviour changed
Status: RESOLVED DUPLICATE of bug 20564
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-20 13:01 UTC by Chris Jefferson
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jefferson 2005-03-20 13:01:31 UTC
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?
Comment 1 Chris Jefferson 2005-03-20 13:03:17 UTC
Stupid webbrowser ¬_¬

*** This bug has been marked as a duplicate of 20564 ***