This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix profile feedback issue with Mozilla
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Jan 2011 22:49:35 +0100
- Subject: Fix profile feedback issue with Mozilla
Hi,
building Mozilla with profile feedback dies at:
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c: In
function 'arena_malloc':
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c:6530:1:
note: correcting inconsistent profile data
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c: In
function 'malloc_mutex_unlock':
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c:6530:1:
error: corrupted profile info: edge from 0 to 2 exceeds maximal count
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c: In
function 'malloc_mutex_lock':
/abuild/jh/mozilla-central2/mozilla-central/memory/jemalloc/jemalloc.c:6530:1:
error: corrupted profile info: edge from 2 to 3 exceeds maximal count
the reason is that malloc makes concurent update into the counter while the
gcov info is streamed, so the maximal counter info is wrong. Given that
Mozilla use -fprofile-correction (to work around lack of thread safety), I
think this should not be hard error, but just an inform, like the other profile
inconsistencies are.
I've tested the patch on Mozilla, will commit it to mainline after
bootstrapping/regtested x86_64-linux.
PR lto/45375
* profile.c (read_profile_edge_counts): Ignore profile inconistency
when correcting profile.
Index: profile.c
===================================================================
--- profile.c (revision 168631)
+++ profile.c (working copy)
@@ -409,8 +409,18 @@
e->count = exec_counts[exec_counts_pos++];
if (e->count > profile_info->sum_max)
{
- error ("corrupted profile info: edge from %i to %i exceeds maximal count",
- bb->index, e->dest->index);
+ if (flag_profile_correction)
+ {
+ static bool informed = 0;
+ if (!informed)
+ inform (input_location,
+ "corrupted profile info: edge count exceeds maximal count",
+ bb->index, e->dest->index);
+ informed = 1;
+ }
+ else
+ error ("corrupted profile info: edge from %i to %i exceeds maximal count",
+ bb->index, e->dest->index);
}
}
else