This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GCOV] Add all blocks mode, and function summaries
Mark Mitchell wrote:
On Thu, 2003-03-27 at 04:27, Nathan Sidwell wrote:
Hi,
this patch adds a mode to gcov where it will output individual counts for
all basic blocks, rather than just those blocks with a line number note.
Such a mode makes it easier to spot unexecuted blocks, such as
if (always-true-expr || never-executed)
built & tested on i686-pc-linux-gnu, ok?
Why does line 13 in the example program have two basic blocks? (It
looks just like line 15 to me, which only has one.)
I don't know, (that'd be a profile.c issue) but at a guess the call
splits the graph, so there's one block upto the call and a second one
containing jump-to-end, afterwards.
The new unions should have a comment indicating how to know which
variant of the union is in use.
ok.
Finally, I'm not sure why:
Also, each block is considered to occupy a single line of
source, rather than multiple lines.
need to reword this to explain that 'the block counts are shown for the
first line of the block. and the block counts only contribute to the execution
counts and occupancy counts of their first line (subsequent lines are
shown unoccupied, unless they begin a separate block)' | user-friendly-filter
Does that mean that:
i = 1;
i = 2;
i = 3;
is considered as three basic blocks?
no, that will be one basic block, and it will be shown as occupying the
'i = 1' line.
the reason for this is subtle. It is my attempt at getting
for (i = 10; i--;) dosomething;
to give a line count of 10, even though the line is only entered from
another line once. TDTR there makes it harder to TDRT for all the lines
of a multi-line block. I considered the former more important to the
latter (the naive approach gives the latter correct, but gives unexpected
cumulative line counts)
ok with those changes?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org