This is the mail archive of the gcc@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: edge types


>What exactly is a fake edge? gcov appears to take fake edges to
>be calls.

When there is a call to a function that might not return, we insert a fake
edge from the call point to the function exit.  This fake edge represents the
execution path taken if the call does not return.  It is fake, to distinguish
it from real edges that occur as the result of branches.  One special aspect
of a fake edge is that you can't add instrumentation code to it, or any other
kind of code for that matter.  Note that practically any function might not
return, since any non-constant function can call exit/abort/longjmp/throw/etc.

The fake edges are needed by gcov to balance the flow graph, so that the
execution counts of the entry and exit nodes will be the same.  This is
because we reduce the instrumentation overhead by only adding code to edges
which are not on the minimal spanning tree.  You can compute the execution
count of the rest of the edges from this set.  This trick only works if the
entry and exit nodes have the same execution count.

Jim


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