From patchwork Tue Nov 1 20:44:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 690145 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 3t7jsN58wFz9t2D for ; Wed, 2 Nov 2016 07:44:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=iTqN7KoP; 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:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=y7LgVSRYTpzP+eT6 UMR2IGSWtI2Kp79cpLJqpfr/MqQyIDbGx57mKAFXNeW9LU+vee+kcAA6xySm9YY4 rTJfCvg+zm16hJcTfNEJFUy6O9Sj1xN6hy8E5KOeV8llm8HdOaCCKQ9R1e/g1ENI ckVZ/fn+KjtUjWx7qSIEAFXfrJk= 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:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=jOSqkR1s9WsuZ2F2s/JGo5 e5XRA=; b=iTqN7KoPN2qyeDahdJpmmVIA9CqwiKEeiVP3TWHZ9aXZZTXdbIM2DD XO+5sLfRKAypmFwjzK0FgkUqRM5MHovTLSE0TPkpxPKxK9etefIqwQ72Ppt3y4Eo CaU/0YVgWpVx0LF34A/pLDXI9cq81pfAg+7xNe71nbltSFzmXjj3w= Received: (qmail 59252 invoked by alias); 1 Nov 2016 20:44:46 -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 59234 invoked by uid 89); 1 Nov 2016 20:44:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Nov 2016 20:44:35 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 932AE729; Tue, 1 Nov 2016 21:44:32 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pdJtRjz1nnvx; Tue, 1 Nov 2016 21:44:29 +0100 (CET) Received: from fuego.CeBiTec.Uni-Bielefeld.DE (p5DCE00AF.dip0.t-ipconnect.de [93.206.0.175]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 8B113728; Tue, 1 Nov 2016 21:44:29 +0100 (CET) From: Rainer Orth To: Jakub Jelinek Cc: Jason Merrill , Cary Coutant , gcc-patches List Subject: Re: [PATCH] DWARF5 .debug_rnglists support References: <20161020185259.GA7282@tucnak.redhat.com> <1aefbb2b-c223-6c76-b224-0230f49cb5ec@redhat.com> <20161031193311.GL3541@tucnak.redhat.com> <20161101161417.GX3541@tucnak.redhat.com> Date: Tue, 01 Nov 2016 21:44:27 +0100 In-Reply-To: <20161101161417.GX3541@tucnak.redhat.com> (Jakub Jelinek's message of "Tue, 1 Nov 2016 17:14:17 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Hi Jakub, > 2016-11-01 Jakub Jelinek > > * tree.h (BLOCK_IN_COLD_SECTION_P): Define. > * final.c (final_scan_insn): Set BLOCK_IN_COLD_SECTION_P. > * dwarf2out.c (rnglist_idx): New variable. > (struct dw_ranges): Add label, idx and maybe_new_sec fields. > (DEBUG_RNGLISTS_SECTION): Define. > (ranges_base_label): New variable. > (size_of_die) : If using > DW_FORM_rnglistx, count size of uleb128 of range list index. > (value_format) : For > -gdwarf-5 -gsplit-dwarf return DW_FORM_rnglistx. > (output_range_list_offset): Handle -gdwarf-5 .debug_rnglists > offsets. Multiply dwarf < 5 offsets by 2 * DWARF_ADDR_SIZE. > (add_ranges_num): Remove useless prototype. Don't multiply > by 2 * DWARF2_ADDR_SIZE. Add maybe_new_sec argument, adjust > for new fields added to dw_ranges struct. > (add_ranges): Add maybe_new_sec argument and pass it > through to add_ranges_num. > (note_rnglist_head): New function. > (add_ranges_by_labels): Pass true as maybe_new_sec to > add_ranges_num, call note_rnglist_head on the head of the list. > (output_ranges): Add function comment. Switch to > .debug_ranges section here and emit .Ldebug_ranges0 label. > (index_rnglists, output_rnglists): New functions. > (gen_subprogram_die): Formatting fixes. > (add_high_low_attributes): Don't divide offsets > by 2 * DWARF2_ADDR_SIZE. Call note_rnglist_head on the > first list element or when pointing into the middle of > a list. Pass true as second argument to add_ranges on the > first block fragment after cold/hot section switch. > (init_sections_and_labels): For -gdwarf-5 use .debug_rnglists > section instead of .debug_ranges. Initialize > ranges_base_label if -gdwarf-5 -gsplit-dwarf. > (dwarf2out_finish): For -gdwarf-5 -gsplit-dwarf call > index_rnglists and add DW_AT_rnglists_base attr. Don't switch > to dwarf_ranges_section here or emit .Ldebug_ranges0 label. > Call output_rnglists for -gdwarf-5. > (dwarf2out_c_finalize): Clear rnglist_idx. this patch broke Solaris bootstrap with /bin/as: /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c: In function 'void output_rnglists()': /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:11055:8: error: unused variable 'basebuf' [-Werror=unused-variable] char basebuf[MAX_ARTIFICIAL_LABEL_BYTES]; ^~~~~~~ /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:11088:16: error: unused variable 'len' [-Werror=unused-variable] unsigned int len = vec_safe_length (ranges_table); ^~~ Fixed as follows; will commit as obvious once i386-pc-solaris2.12 and sparc-sun-solaris2.12 bootstrap have finished successfully. Rainer # HG changeset patch # Parent 82d985a9e114ce85dac367da31077070f40d7ab8 Fix dwarf2out.c non-leb128 bootstrap failure diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11052,7 +11052,9 @@ output_rnglists (void) dw_ranges *r; char l1[MAX_ARTIFICIAL_LABEL_BYTES]; char l2[MAX_ARTIFICIAL_LABEL_BYTES]; +#ifdef HAVE_AS_LEB128 char basebuf[MAX_ARTIFICIAL_LABEL_BYTES]; +#endif switch_to_section (debug_ranges_section); ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label); @@ -11085,9 +11087,9 @@ output_rnglists (void) ranges_base_label, NULL); } - unsigned int len = vec_safe_length (ranges_table); const char *lab = ""; #ifdef HAVE_AS_LEB128 + unsigned int len = vec_safe_length (ranges_table); const char *base = NULL; #endif FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)