From patchwork Mon Nov 18 19:30:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1196913 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513950-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="f9d3ek8y"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47GzZq0jdhz9sPJ for ; Tue, 19 Nov 2019 06:30:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=O8YShbYr/jWi141geg5VcrmvkEMf/5645LjUToa63StMQUj+4IjIq Ef1K4vRZPPPFV1XfQKbLjnHvhTPXW3PvolNYUnbkq+MGWVBFzDajMAaOhnFqVp5t 4iZyYjfR7F4dldgmQcNvWKtUS2SgC8odUohWQJc9xFpq8V/bA1lP30= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=p4zk8rgLSEQKIBeMIhZsCFZyz+4=; b=f9d3ek8yeUY/Ous5Z+O7 fm/Rw+vhvmlxTD5bzWtbWKWlpHsj37DgdRC4uxgdLnLqZzX8DMlBDtETmU4h01SY LG1s/8DzvhoySGFlf5fBgb+3su8yJpxTh0WDkCftCPy85fXU2B7AeLnEGICIcMWo qL2fCVJxTtVtni5r25MNqD4= Received: (qmail 47642 invoked by alias); 18 Nov 2019 19:30:48 -0000 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 Received: (qmail 47512 invoked by uid 89); 18 Nov 2019 19:30:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=inlined_to X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2019 19:30:38 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 66E4B2862DC; Mon, 18 Nov 2019 20:30:34 +0100 (CET) Date: Mon, 18 Nov 2019 20:30:34 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix ICE in do_estimate_edge_time Message-ID: <20191118193034.o37elysskdjqn3nz@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this patch fixes two problems triggered by lto boostrap lean. First inline_small_functions starts adding new edges before reseting old data in cache. Second is about disabling the test for functions with IPA count (since updating it triggers small roundoff errors) which incorrectly ask count of edge->callee which may be an alias. lto-lean-profiledbootstrapped/regtested x86_64-linux, comitted. PR ipa/92508 * ipa-inline.c (inline_small_functions): Add new edges after reseting caches. * ipa-inline-analysis.c (do_estimate_edge_time): Fix sanity check. Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 278390) +++ ipa-inline.c (working copy) @@ -2136,9 +2135,8 @@ inline_small_functions (void) gcc_checking_assert (!callee->inlined_to); inline_call (edge, true, &new_indirect_edges, &overall_size, true); - add_new_edges_to_heap (&edge_heap, new_indirect_edges); - reset_edge_caches (edge->callee); + add_new_edges_to_heap (&edge_heap, new_indirect_edges); update_callee_keys (&edge_heap, where, updated_nodes); } Index: ipa-inline-analysis.c =================================================================== --- ipa-inline-analysis.c (revision 278390) +++ ipa-inline-analysis.c (working copy) @@ -211,7 +211,7 @@ do_estimate_edge_time (struct cgraph_edg nonspec_time = e->entry.nonspec_time; hints = e->entry.hints; if (flag_checking - && !edge->callee->count.ipa_p ()) + && !callee->count.ipa_p ()) { sreal chk_time, chk_nonspec_time; int chk_size, chk_min_size;