From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77461 invoked by alias); 6 Dec 2015 05:46:58 -0000 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 Received: (qmail 77391 invoked by uid 89); 6 Dec 2015 05:46:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 06 Dec 2015 05:46:35 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 0DCAD541672; Sun, 6 Dec 2015 06:46:30 +0100 (CET) Date: Sun, 06 Dec 2015 05:46:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix ipa-icf.c segfault Message-ID: <20151206054630.GA96755@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-12/txt/msg00668.txt.bz2 Hi, this patch fixes segfault that crept into my prevoius patch. Bootstrapped/regtested x86_64-linux, comitted. Honza * ipa-icf.c (sem_function::merge): Check that local_original exists. Index: ipa-icf.c =================================================================== --- ipa-icf.c (revision 231319) +++ ipa-icf.c (working copy) @@ -1359,7 +1359,9 @@ sem_function::merge (sem_item *alias_ite { if (dump_file) fprintf (dump_file, "Dropping merged_comdat flag.\n\n"); - local_original->merged_comdat = original->merged_comdat = false; + if (local_original) + local_original->merged_comdat = false; + original->merged_comdat = false; } if (remove)