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: 80408 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp820015qge; Tue, 1 Nov 2016 13:45:00 -0700 (PDT) X-Received: by 10.98.150.79 with SMTP id c76mr62697287pfe.154.1478033100835; Tue, 01 Nov 2016 13:45:00 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q1si11731035pad.204.2016.11.01.13.45.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 13:45:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-440102-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-440102-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-440102-patch=linaro.org@gcc.gnu.org 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=QH41MhLHSNIVk4k0 jusbBBB1Xd4G1dp0KR8ZlZ9I4U/twIm9sRhtbHG6a3wr6rBUl/vWEg5bXUNiy4J8 W5BcKAEO2csmZW8T8wTR44d4ZDwkRc5M/6nXrgYUUf/5xddL4g/8+961ShuyZAzq z/i3IMkxUaFXfMM+Ysjmk6FhIUo= 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=TRc/dbkcb8tKsb1E+HLi/ykdWW9cP/o0g5Ffv72Zx7vCip1tWT8XqL /RoUga4hX2Y1zEcryU3/ymfzZK2qR/UMtyt69tN3Qxlkk+HzLHfKy1tpe0If9koI i01lN7Cws0jxta4SLwa41L3QGidQAtGQTAiLl5JkLGVb18C3Qjzxg= 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 -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2016-11-01 Rainer Orth * dwarf2out.c (output_rnglists): Wrap basebuf, len in HAVE_AS_LEB128. # 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)