From patchwork Wed Sep 28 09:26:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 676109 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 3skXQt3Jypz9t17 for ; Wed, 28 Sep 2016 19:27:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=KRxMFYHC; 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=WsBUYbeflYbhwLkh c1MvO0Mofou3ltGGrGhhXcONqF08iTXtDx4y6kW22Ux+XPyuwHBeX1EldTzRAjK8 LZV1j+k5mCmlLl2JIVqJyNyP0FxbShb2GCSErllIsrjuhjqcnSbmGamZjmGqw5YS 70CmCwM73DB6adyjlhSbBLQorkw= 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=LxRcQv0IUFcVlUOs8y+b80 MeZzM=; b=KRxMFYHCZ7B+8q/PKmCC0gfAfC+JTf4UOgR0QZ+gIGCP3VfjemFjKX 3RJPyBTWa8iY57zsNysEblO1Sp/1cZv2AbhmIBhUNbQHxAHqy9SCE+1vjHZxBtgN nWx+i0pHN5YN0MQULEMNOu7f8p5I6HAWrCs3I7zbqjkct51WDWPwQ= Received: (qmail 89081 invoked by alias); 28 Sep 2016 09:26:54 -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 89025 invoked by uid 89); 28 Sep 2016 09:26:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=25397, 2539, 7, Hx-languages-length:2442, H*r:PDT X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Sep 2016 09:26:41 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1bpB8O-0003HE-GW from Thomas_Schwinge@mentor.com ; Wed, 28 Sep 2016 02:26:36 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Wed, 28 Sep 2016 02:26:36 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 9605DC2319; Wed, 28 Sep 2016 02:26:35 -0700 (PDT) From: Thomas Schwinge To: Richard Biener , Rainer Orth , Bernd Schmidt CC: , Subject: Un-break dwarf2out for DWARF2_LINENO_DEBUGGING_INFO configurations (was: [PATCH] Refactor section/label init for early LTO debug) In-Reply-To: References: User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Wed, 28 Sep 2016 11:26:29 +0200 Message-ID: <87lgycnzne.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Tue, 27 Sep 2016 12:34:46 +0200 (CEST), Richard Biener wrote: > --- gcc/dwarf2out.c (revision 240521) > +++ gcc/dwarf2out.c (working copy) > @@ -25657,14 +25687,6 @@ dwarf2out_init (const char *filename ATT > vec_alloc (macinfo_table, 64); > #endif > > - /* Make sure the line number table for .text always exists. */ > - text_section_line_info = new_line_info_table (); > - text_section_line_info->end_label = text_end_label; > - > -#ifdef DWARF2_LINENO_DEBUGGING_INFO > - cur_line_info_table = text_section_line_info; > -#endif > - > /* If front-ends already registered a main translation unit but we were > not > ready to perform the association, do this now. */ > if (main_translation_unit != NULL_TREE) > @@ -25688,6 +25710,14 @@ dwarf2out_assembly_start (void) > ASM_OUTPUT_LABEL (asm_out_file, text_section_label); > #endif > > + /* Make sure the line number table for .text always exists. */ > + text_section_line_info = new_line_info_table (); > + text_section_line_info->end_label = text_end_label; > + > +#ifdef DWARF2_LINENO_DEBUGGING_INFO > + cur_line_info_table = text_section_line_info; > +#endif > + > if (HAVE_GAS_CFI_SECTIONS_DIRECTIVE > && dwarf2out_do_cfi_asm () > && (!(flag_unwind_tables || flag_exceptions) (This got committed in r240545.) For DWARF2_LINENO_DEBUGGING_INFO configurations (that is, nvptx; Bernd CCed, who originally authored the DWARF2_LINENO_DEBUGGING_INFO support), this breaks things because of uninitialized text_section_line_info/cur_line_info_table. OK to fix as follows? commit e745307ac5a90e999133dfeeee21139526230e81 Author: Thomas Schwinge Date: Wed Sep 28 10:55:23 2016 +0200 Un-break dwarf2out for DWARF2_LINENO_DEBUGGING_INFO configurations gcc/ * dwarf2out.c (dwarf2_lineno_debug_hooks): Use dwarf2out_assembly_start. --- gcc/dwarf2out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Grüße Thomas diff --git gcc/dwarf2out.c gcc/dwarf2out.c index 51cab42..8c18c4c 100644 --- gcc/dwarf2out.c +++ gcc/dwarf2out.c @@ -2539,7 +2539,7 @@ const struct gcc_debug_hooks dwarf2_lineno_debug_hooks = dwarf2out_init, debug_nothing_charstar, debug_nothing_charstar, - debug_nothing_void, + dwarf2out_assembly_start, debug_nothing_int_charstar, debug_nothing_int_charstar, debug_nothing_int_charstar,