From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6604 invoked by alias); 4 Feb 2015 22:56:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6457 invoked by uid 48); 4 Feb 2015 22:56:24 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/64686] [5 Regression] ICE: in edge_badness, at ipa-inline.c:912 during Firefox LTO build with enabled checking Date: Wed, 04 Feb 2015 22:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg00390.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64686 --- Comment #7 from Jan Hubicka --- It is an ordering issue. We are adding edges to heap and resolving speculations at once that means that we have temporarily wrong summaries. I am testing the following that should not affect codegen in any important way except for random changes of functions with the same priority. Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 220417) +++ ipa-inline.c (working copy) @@ -1702,6 +1702,7 @@ inline_small_functions (void) { bool update = false; struct cgraph_edge *next; + bool has_speculative = false; if (dump_file) fprintf (dump_file, "Enqueueing calls in %s/%i.\n", @@ -1719,12 +1720,17 @@ inline_small_functions (void) gcc_assert (!edge->aux); update_edge_key (&edge_heap, edge); } - if (edge->speculative && !speculation_useful_p (edge, edge->aux != NULL)) + if (edge->speculative) + has_speculative = true; + } + if (has_speculative) + for (edge = node->callees; edge; edge = next) + if (edge->speculative && !speculation_useful_p (edge, + edge->aux != NULL)) { edge->resolve_speculation (); update = true; } - } if (update) { struct cgraph_node *where = node->global.inlined_to