Comment 32 for bug 598462

Revision history for this message
Ulrich Weigand (uweigand) wrote :

It turns out there is no other problem on 4.6. The compiler in the ubuntu-toolchain-r/test ppa does not build Python at all due to PR 47271. After adding the fix for this PR to the ppa package, the compiler runs into the exact same problem as described for 4.5 in the previous comment. By using -fprofile-correction as above, I was able to successfully build the python3.2-3.2~rc1 package with profile-directed feedback enabled (on i386).

So to summarize the problems discussed in this thread:

- GCC 4.6 had a regression where it failed to built Python at all. This is PR 47271, and is already fixed in mainline.

- GCC (any version!) uses thread-unsafe code to update profile counters, which means they can always be slightly wrong when profiling multi-threaded code, and therefore inconsistent with the flow graph. This will happen most frequently on multi-core machines, and in functions that experience high thread contention. The problem can be worked around using -fprofile-correction. Using this flag should enable profiled builds of Python with (at least) GCC 4.5 and 4.6.