This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: edge types
- From: Jim Wilson <wilson at redhat dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 08 Jul 2002 17:29:09 -0400
- Subject: Re: edge types
- References: <3D2750C0.327F9DC3@codesourcery.com>
>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