From patchwork Tue Feb 21 12:54:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 730521 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vSL6m1yGsz9s3v for ; Tue, 21 Feb 2017 23:54:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PYSBQcNM"; dkim-atps=neutral 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=qu3nAcpQJVAPrONSqU7OO5Ic6M/8HYuL0/TX1FoMG2/4zTjiF7lFY xd9OlvO0y/+1Xtc22WhgBqvr7/AY9YqkBTnWfjZc16oMlxgP7RlEIp4itkQyiMsD 2NGO21jT8KZV/EHlBw0HKG/ikMmyVe3qfsYN2S6Qby+6i65tf6WGxE= 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=2PaLYZVuBKm8+0c1dnuOGx0VshA=; b=PYSBQcNMR2eEY3wlBR3N Lc1NPkfYBotYWx3Z/LK81GnfaaE6R7zQ5Gt0gMSoxrDLWvM4pZsLgk2XQ/zP6rFj 2aiV+9Wkljp3/iHZfQwb0aEqpv4adn+puCfIXYA2yi9DQEz6jc6hlxf1exagHUrv e8Ag+qXANDKWJrBpNShBFvM= Received: (qmail 83678 invoked by alias); 21 Feb 2017 12:54:16 -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 83663 invoked by uid 89); 21 Feb 2017 12:54:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=encoder X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Feb 2017 12:54:14 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A0624ABCD for ; Tue, 21 Feb 2017 12:54:12 +0000 (UTC) Date: Tue, 21 Feb 2017 13:54:12 +0100 From: Martin Jambor To: GCC Patches Subject: [PR 79579] Avoid segfault on NULL ipa_edge_args_vector Message-ID: <20170221125412.j2fpeiirzz377wwp@virgil.suse.cz> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes Hi, in, PR 79579, early inliner creates ipa_node_params_sum which is then tested by ipa_prop_write_jump_functions to figure out whether there has been anything to stream out when there is not. The following patch improves the test - when there are no jump function, there is no point in streaming jump functions or any ipa-cp info in general. Bootstrapped and tested on x86_64-linux, I will commit it momentarily as obvious. Thanks, Martin 2017-02-20 Martin Jambor PR lto/79579 * ipa-prop.c (ipa_prop_write_jump_functions): Bail out if no edges have been analyzed. --- gcc/ipa-prop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index e4e44ce20c6..33503d4befc 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -5040,7 +5040,7 @@ ipa_prop_write_jump_functions (void) lto_symtab_encoder_iterator lsei; lto_symtab_encoder_t encoder; - if (!ipa_node_params_sum) + if (!ipa_node_params_sum || !ipa_edge_args_vector) return; ob = create_output_block (LTO_section_jump_functions);