This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
bad gcno generation
- From: Michael Morrell <morrell at alumni dot ucsd dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 16 Jun 2008 16:41:15 -0700 (PDT)
- Subject: bad gcno generation
- Reply-to: morrell at alumni dot ucsd dot edu
I'm seeing some strange results in the gcno file created from -fprofile-arcs
in gcc 4.2.3.
My input file is simply:
===============================
int main(int argc, char **argv)
{
}
===============================
When I run "gcc -fprofile-arcs foo.c", the gcno file seems OK
(the output is from using the gcno reader from lcov):
===============================
foo.c,main,2
foo.c,2
foo.c,3
===============================
but when I use g++ instead ("g++ -fprofile-arcs foo.cpp"), I get:
===============================
foo.cpp,main,1
foo.cpp,1
ERROR: reading string
===============================
First, I don't understand why the line number for main is different,
but the real bug is that the gcno file contains a line number of 0 as
part of the data for this basic block which I don't believe has any
meaning. Certainly the lcov tools get confused.
Any ideas?
Michael