From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32476 invoked by alias); 19 Oct 2011 16:42:07 -0000 Received: (qmail 32468 invoked by uid 22791); 19 Oct 2011 16:42:06 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Oct 2011 16:41:51 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 014179AC6AB; Wed, 19 Oct 2011 18:41:49 +0200 (CEST) Date: Wed, 19 Oct 2011 17:15:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: PR bootstrap/50709 (bootstrap miscompare) Message-ID: <20111019164149.GG18858@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg01751.txt.bz2 Hi, the ENABLE_CHECKING code verifying consistency of inliner cache has effect on changing order of querries to the fibheap that consequentely makes entries with same key come in different orders. Fixed by enabling the checking aways. I also added extra check that the keys are conservatively correct. Bootstrapped/regtested x86_64-linux. Index: ChangeLog =================================================================== --- ChangeLog (revision 180190) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-10-19 Jan Hubicka + + PR bootstrap/50709 + * ipa-inline.c (inline_small_functions): Fix checking code to not make + effect on fibheap stability. + 2011-10-19 Roland Stigge PR translation/48638 Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 180190) +++ ipa-inline.c (working copy) @@ -1384,6 +1384,7 @@ inline_small_functions (void) struct cgraph_node *where, *callee; int badness = fibheap_min_key (heap); int current_badness; + int cached_badness = -1; int growth; edge = (struct cgraph_edge *) fibheap_extract_min (heap); @@ -1392,16 +1393,20 @@ inline_small_functions (void) if (!edge->inline_failed) continue; - /* Be sure that caches are maintained consistent. */ #ifdef ENABLE_CHECKING + /* Be sure that caches are maintained conservatively consistent. + This means that cached badness is allways smaller or equal + to the real badness. */ + cached_badness = edge_badness (edge, false); +#endif reset_edge_growth_cache (edge); reset_node_growth_cache (edge->callee); -#endif /* When updating the edge costs, we only decrease badness in the keys. Increases of badness are handled lazilly; when we see key with out of date value on it, we re-insert it now. */ current_badness = edge_badness (edge, false); + gcc_assert (cached_badness == -1 || cached_badness <= current_badness); gcc_assert (current_badness >= badness); if (current_badness != badness) {