From patchwork Fri Apr 1 21:18:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 89345 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]) by ozlabs.org (Postfix) with SMTP id 57DF6B6F7E for ; Sat, 2 Apr 2011 08:18:58 +1100 (EST) Received: (qmail 18563 invoked by alias); 1 Apr 2011 21:18:55 -0000 Received: (qmail 18553 invoked by uid 22791); 1 Apr 2011 21:18:53 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Apr 2011 21:18:43 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p31LIgOS005028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Apr 2011 17:18:43 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p31LIgVp025894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 1 Apr 2011 17:18:42 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (localhost.localdomain [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id p31LIfZk013783 for ; Fri, 1 Apr 2011 23:18:41 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id p31LIfe5013726 for gcc-patches@gcc.gnu.org; Fri, 1 Apr 2011 23:18:41 +0200 Date: Fri, 1 Apr 2011 23:18:40 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] (partially) fix lto bootstrap (PR bootstrap/48148) Message-ID: <20110401211840.GD18914@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! richi's lto-cgraph.c change actually didn't do anything, because DECL_ABSTRACT_ORIGIN is still NULL there, see PR for details. This patch instead doesn't try to force dies for DECL_ABSTRACT_ORIGIN DECL_EXTERNAL decls, as dwarf2out isn't prepared to handle them. Bootstrapped/regtested on x86_64-linux and i686-linux, attempted also LTO bootstrap, but it failed in other unrelated places (x86_64 somewhere in Ada and i686 because it was trying to emit .Ldebug_info0 twice). I'll try to look at those later, but this is a step forward, approved on IRC by rth. 2011-04-01 Jakub Jelinek PR bootstrap/48148 * dwarf2out.c (resolve_addr): Don't call force_decl_die if DECL_EXTERNAL has non-NULL DECL_ABSTRACT_ORIGIN. Revert: 2011-03-17 Richard Guenther PR bootstrap/48148 * lto-cgraph.c (input_overwrite_node): Clear the abstract origin for decls in other ltrans units. (input_varpool_node): Likewise. Jakub --- gcc/dwarf2out.c.jj 2011-04-01 11:04:36.000000000 +0200 +++ gcc/dwarf2out.c 2011-04-01 18:08:30.864796302 +0200 @@ -23023,7 +23023,9 @@ resolve_addr (dw_die_ref die) { tree tdecl = SYMBOL_REF_DECL (a->dw_attr_val.v.val_addr); dw_die_ref tdie = lookup_decl_die (tdecl); - if (tdie == NULL && DECL_EXTERNAL (tdecl)) + if (tdie == NULL + && DECL_EXTERNAL (tdecl) + && DECL_ABSTRACT_ORIGIN (tdecl) == NULL_TREE) { force_decl_die (tdecl); tdie = lookup_decl_die (tdecl); --- gcc/lto-cgraph.c.jj 2011-03-17 16:20:09.000000000 +0100 +++ gcc/lto-cgraph.c 2011-04-01 18:02:37.570845862 +0200 @@ -975,7 +975,6 @@ input_overwrite_node (struct lto_file_de || node->clone_of->decl != node->decl)) { DECL_EXTERNAL (node->decl) = 1; - DECL_ABSTRACT_ORIGIN (node->decl) = NULL_TREE; TREE_STATIC (node->decl) = 0; } node->alias = bp_unpack_value (bp, 1); @@ -1147,7 +1146,6 @@ input_varpool_node (struct lto_file_decl if (node->in_other_partition) { DECL_EXTERNAL (node->decl) = 1; - DECL_ABSTRACT_ORIGIN (node->decl) = NULL_TREE; TREE_STATIC (node->decl) = 0; } aliases_p = bp_unpack_value (&bp, 1);