From patchwork Mon Jan 10 21:49:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 78243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D7C67B71BC for ; Tue, 11 Jan 2011 08:49:49 +1100 (EST) Received: (qmail 12126 invoked by alias); 10 Jan 2011 21:49:46 -0000 Received: (qmail 12115 invoked by uid 22791); 10 Jan 2011 21:49:45 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Jan 2011 21:49:37 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 72C619AC79B; Mon, 10 Jan 2011 22:49:35 +0100 (CET) Date: Mon, 10 Jan 2011 22:49:35 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix profile feedback issue with Mozilla Message-ID: <20110110214935.GA2858@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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