From patchwork Mon Oct 28 08:21:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1185249 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-511874-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="ynMBSyMp"; 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 471njq2ZFvz9sP3 for ; Mon, 28 Oct 2019 19:21:17 +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=PBlMQklbjo1Li4q5Aap61vRwzp7u1n3M9ffaiclWQwzjENrhts6g+ nnQgylVVBv/U6JXzf/Os6qwB3PUGLr7TF/OLl4wB0D3u2kvym7ka2BjJkKSzflAO +omvNuBwhiC90zg+wDp8KGSPn1IfquqCNcLwA5P0W8r1WYAvEJ6fMI= 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=AJnvh4lfYqc3MRPcaGHSfXT9jtk=; b=ynMBSyMp8hFj30B37Zeh YjZb/qnL4SlcSW1TlgFlcDB6qwxe6hlpia3Vk9KSPmCAjEzNSb1J/ogKXRwkrVGw s5Z+dChyetZiAIFqFcCnqq03RtkB5xzNJ/8aqhsXWPP4TMB91cJ+og4nYi3g3s9O 6mTyPOBOV7bfcU5lwjbY6pc= Received: (qmail 24806 invoked by alias); 28 Oct 2019 08:21:09 -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 24797 invoked by uid 89); 28 Oct 2019 08:21:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=ici 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, 28 Oct 2019 08:21:07 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 4A2AC280834; Mon, 28 Oct 2019 09:21:05 +0100 (CET) Date: Mon, 28 Oct 2019 09:21:05 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix ICE in updating inline summaries Message-ID: <20191028082105.6xhdxkjvgttrpszd@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, my yesterday patch introduced ICE on combining -O2 and -O0 translation units (since the second has missing summary). Bootstrapped/regtested x86_64-linux, comitted. Honza * ipa-fnsummary.c (ipa_merge_fn_summary_after_inlining): Check for missing EDGE_REF * ipa-prop.c (update_jump_functions_after_inlining): Likewise. Index: ipa-fnsummary.c =================================================================== --- ipa-fnsummary.c (revision 277503) +++ ipa-fnsummary.c (working copy) @@ -3315,7 +3315,7 @@ ipa_merge_fn_summary_after_inlining (str if (ipa_node_params_sum && callee_info->conds) { class ipa_edge_args *args = IPA_EDGE_REF (edge); - int count = ipa_get_cs_argument_count (args); + int count = args ? ipa_get_cs_argument_count (args) : 0; int i; if (count) Index: ipa-prop.c =================================================================== --- ipa-prop.c (revision 277503) +++ ipa-prop.c (working copy) @@ -2741,7 +2741,7 @@ update_jump_functions_after_inlining (st /* We must check range due to calls with variable number of arguments and we cannot combine jump functions with operations. */ if (dst->value.pass_through.operation == NOP_EXPR - && (dst->value.pass_through.formal_id + && (top && dst->value.pass_through.formal_id < ipa_get_cs_argument_count (top))) { int dst_fid = dst->value.pass_through.formal_id; @@ -3430,7 +3430,7 @@ update_indirect_edges_after_inlining (st continue; /* We must check range due to calls with variable number of arguments: */ - if (ici->param_index >= ipa_get_cs_argument_count (top)) + if (!top || ici->param_index >= ipa_get_cs_argument_count (top)) { ici->param_index = -1; continue;