From patchwork Tue May 8 15:31:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 910291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-477373-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="Iu7QM/GC"; 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 40gNkq567dz9s0W for ; Wed, 9 May 2018 01:31:47 +1000 (AEST) 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=ZoKpkPy0thkTz86gOjYkAaoFlChNRmNU3p+dwxNXEmmZTpe/dZ9x9 f3w64RoBBICqPgn2/kqD4b55F/+3mO+khqO1s6d2z6UoMwBIuzw5UQNxErYtk8DH bhqaHMTsSoMDGxI/DMNFbCSvjRfJ4dSqJ7CXrpaY95OFTqeUKssDVA= 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=iVCmeO93fQJyr2K5LryNvGN1hvg=; b=Iu7QM/GCmCx3qzICUgpN juUgqcm+bu+ZYlwznP77+HdNQld9rnB4bOiJFYfIkWCKSW2QylW6E99Ty1Ujrv0B Lcxw5qmzW9J818zaNwaqf/NO+Did1z0ONiOZF6DR8xZbmPWk4F/OBLTVAi5aWLvv wuS9RiUU3VezBRykuU5WsqA= Received: (qmail 108705 invoked by alias); 8 May 2018 15:31:40 -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 107750 invoked by uid 89); 8 May 2018 15:31:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy= 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; Tue, 08 May 2018 15:31:39 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 23026540A3E; Tue, 8 May 2018 17:31:37 +0200 (CEST) Date: Tue, 8 May 2018 17:31:37 +0200 From: Jan Hubicka To: rguenther@suse.de, gcc-patches@gcc.gnu.org Subject: Incremental LTO linking part 6: dwarf2out support Message-ID: <20180508153137.GF16916@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Hi, this patch tells dwarf2out that it can have early debug not only in WPA mode but also when incrementally linking. This prevents ICE on almost every testcase compiled with -g. Bootstrapped/regtested x86_64-linux with rest of incremental linking patchet. Makes sense? Honza * dwarf2out.c (dwarf2out_die_ref_for_decl, darf2out_register_external_decl): Support incremental link. Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 260042) +++ dwarf2out.c (working copy) @@ -5822,7 +5822,7 @@ { dw_die_ref die; - if (flag_wpa && !decl_die_table) + if ((flag_wpa || flag_incremental_link == 2) && !decl_die_table) return false; if (TREE_CODE (decl) == BLOCK) @@ -5832,10 +5832,10 @@ if (!die) return false; - /* During WPA stage we currently use DIEs to store the - decl <-> label + offset map. That's quite inefficient but it - works for now. */ - if (flag_wpa) + /* During WPA stage and incremental linking we currently use DIEs + to store the decl <-> label + offset map. That's quite inefficient + but it works for now. */ + if (flag_wpa || flag_incremental_link == 2) { dw_die_ref ref = get_AT_ref (die, DW_AT_abstract_origin); if (!ref) @@ -5886,7 +5886,7 @@ if (debug_info_level == DINFO_LEVEL_NONE) return; - if (flag_wpa && !decl_die_table) + if ((flag_wpa || flag_incremental_link == 2) && !decl_die_table) decl_die_table = hash_table::create_ggc (1000); dw_die_ref die @@ -5921,7 +5921,8 @@ parent = BLOCK_DIE (ctx); else if (TREE_CODE (ctx) == TRANSLATION_UNIT_DECL /* Keep the 1:1 association during WPA. */ - && !flag_wpa) + && !flag_wpa + && flag_incremental_link != 2) /* Otherwise all late annotations go to the main CU which imports the original CUs. */ parent = comp_unit_die (); @@ -5942,7 +5943,7 @@ switch (TREE_CODE (decl)) { case TRANSLATION_UNIT_DECL: - if (! flag_wpa) + if (! flag_wpa && flag_incremental_link != 2) { die = comp_unit_die (); dw_die_ref import = new_die (DW_TAG_imported_unit, die, NULL_TREE);