From patchwork Thu Feb 19 12:11:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 441589 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 BE0A41400F1 for ; Thu, 19 Feb 2015 23:11:23 +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:reply-to:mime-version:content-type; q=dns; s=default; b=xu8mt2wlVe+qG0TNmLPAKERFkgBLL1TiP62W/JK8ALz eGjwyhZGtFJG3j8iVO0XrUZaQj3jhbz2lxLlulQnPeMITVo7RxGKHi1Hh3vIdJfB G459tRMaCt3cTEwq6/Q0Eaf+jIUjMkjg24oSixHvy2L9KsnOcQ7x/n5t6T1F9R0k = 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:reply-to:mime-version:content-type; s=default; bh=+xbrc2iyyXaNVmrfxWGQ9uAYWOc=; b=PrVwG4dG+617TAbUc zcdYay7muhc6UcS4kDoj3KfriQPBUkHDxuxB6gjC4rdaK16ltsdaHGs5dG4vftem WqpVAn7am0EdHIYPXhIR2NnaCTlVrenbVUt8nxLD9jl3bDMEiMRF+I6/+oVvxzTF BIA348OkjdGlcQBGakYhkqTNug= Received: (qmail 15685 invoked by alias); 19 Feb 2015 12:11:15 -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 15670 invoked by uid 89); 19 Feb 2015 12:11:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 19 Feb 2015 12:11:13 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1JCBAP3029569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 19 Feb 2015 07:11:11 -0500 Received: from tucnak.zalov.cz (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1JCB9KB002896 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 19 Feb 2015 07:11:10 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t1JCB7bk003874 for ; Thu, 19 Feb 2015 13:11:08 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t1JCB6dg003873 for gcc-patches@gcc.gnu.org; Thu, 19 Feb 2015 13:11:06 +0100 Date: Thu, 19 Feb 2015 13:11:06 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix LTO -g ICE (PR lto/65012) Message-ID: <20150219121106.GD1746@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi! When building systemd with LTO and -g, we ICE, because we stream in __PRETTY_FUNCTION__ VAR_DECL, which isn't referenced in the IL except for BLOCK_VARS and thus doesn't get a varpool node streamed with it. Later on when dwarf2out.c calls make_decl_rtl_for_debug on it, it creates the varpool_node, but it has of course NULL lto_file_data, but get_constructor assumes it isn't NULL. Fixed thusly, bootstrapped/regtested on x86_64-linux, i686-linux and aarch64-linux, tested it fixes systemd LTO -g build. Acked by Honza privately on IRC, committed to trunk. 2015-02-19 Jakub Jelinek PR lto/65012 * varpool.c (varpool_node::get_constructor): Return early if this->lto_file_data is NULL. Jakub --- gcc/varpool.c.jj 2015-02-16 11:19:05.000000000 +0100 +++ gcc/varpool.c 2015-02-18 19:57:10.743001889 +0100 @@ -303,7 +303,8 @@ varpool_node::get_constructor (void) size_t len; if (DECL_INITIAL (decl) != error_mark_node - || !in_lto_p) + || !in_lto_p + || !lto_file_data) return DECL_INITIAL (decl); timevar_push (TV_IPA_LTO_CTORS_IN);