This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35544] Error with -fprofile-use
- From: "wilson at tuliptree dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2008 06:02:13 -0000
- Subject: [Bug middle-end/35544] Error with -fprofile-use
- References: <bug-35544-9436@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from wilson at tuliptree dot org 2008-03-13 06:02 -------
Subject: Re: New: Error with -fprofile-use
xinliangli at gmail dot com wrote:
> In the following example, profile data generated by -O0 binary run can not be
> used for profile-use at -O2. This is either a bug or design flaw if not
> supported.
Gcc constructs a minimal spanning tree for the CFG, and then only adds
instrumentation code to arcs that are not on the minimal spanning tree.
We can compute arc counts for the rest of the CFG from this set. We
can compute basic block execution counts from the arc counts. This
reduces the run-time cost of the instrumentation code, since only a
small fraction of the basic blocks require profiling code. However, it
also requires that we have exactly the same CFG with -fprofile-generate
as we have with -fprofile-use, and hence you must use the same
optimization options with both compiles.
Jim
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35544