Hello, the problem seems to have returned, similar problems have been reported several times at least in the 4.0.0 prerelease time, as far as Google tells.
See gcc.gnu.org/ml/gcc/2005-03/msg00844.html http://kegel.com/crosstool/crosstool-0.38/patches/gcc-4.0.1/pr20815-fix.patch I have a larger code base, where the compiler bails out at every first occurence of unnamed namespaces with -fprofile-use. The working files get a remarkable speedup due to profile-use, so I would prefer to be able to use it for all files without having to assign the namespaces names. I can get away for the moment by compiling the failing files without -fprofile-use. Thanks, Bernd Strieder proft1.cc: ------------------------------------------------------ namespace { int calc(int j) { if (j==0) return 0; return calc(j-1)*j % 17; } } int main(void) { return calc(25); } -------------------------- Steps to reproduce: g++ -fprofile-generate -c proft1.cc g++ -fprofile-generate -o proft1 proft1.o ./proft1 g++ -fprofile-use -c proft1.cc proft1.cc: In function 'int<unnamed>::calc(int)': proft1.cc:13: error: coverage mismatch for function '_ZN38_GLOBAL__N_proft1.cc_00000000_DA7CA6ED4calcEi' while reading counter 'arcs' proft1.cc:13: error: checksum is 2c81fd4d instead of dd8ba62c -- Summary: -fprofile-use fails with unnamed namespaces in 4.1.0 prerelease Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: strieder at informatik dot uni-kl dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26399