From patchwork Fri Nov 6 01:34:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 540784 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 8761C1402BC for ; Fri, 6 Nov 2015 12:36:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=jQYj/nj2; 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 :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= default; b=AwK+CjzrvvWPQzSpPWtrydjfe1caKpyTjbiKyYslKIYZDNUpy/o9O Qn8e3jYIv7JpsMBUaOZdGJFkIco2Dbavu7tT4iIWqDrABkKYQ6WR4voLywSjlejf GNnNXN0zHdPW6n7Ulv/wu87pRVbuCjd+7ieou13r8m7LnB7e++4ByY= 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 :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=default; bh=fsnGkwhBRkTOPaye74Qf1MRI0nQ=; b=jQYj/nj2DAqaRSB4sX/VXT3MI/7M 8Opl31Q+X02NfJGJZBIUnoU07Y1bZgtkJBkBBKYupkLeK/whrdbt4P++aYfXAqHg whUlfLH1M0QZe/u1sia8EFz9VB7yQzjIQ8DA/cg8oGSAvWudmgqNn4XPwVhdmSTX Wg8z37Ic8CDm5g4= Received: (qmail 49099 invoked by alias); 6 Nov 2015 01:35: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 49072 invoked by uid 89); 6 Nov 2015 01:35:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: resqmta-po-12v.sys.comcast.net Received: from resqmta-po-12v.sys.comcast.net (HELO resqmta-po-12v.sys.comcast.net) (96.114.154.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 06 Nov 2015 01:35:52 +0000 Received: from resomta-po-03v.sys.comcast.net ([96.114.154.227]) by resqmta-po-12v.sys.comcast.net with comcast id e1bi1r0014ueUHc011brkC; Fri, 06 Nov 2015 01:35:51 +0000 Received: from [IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d] ([IPv6:2001:558:6045:a4:40c6:7199:cd03:b02d]) by resomta-po-03v.sys.comcast.net with comcast id e1bo1r00Q2ztT3H011bpBE; Fri, 06 Nov 2015 01:35:50 +0000 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [ping] Fix PR debug/66728 From: Mike Stump In-Reply-To: Date: Thu, 5 Nov 2015 17:34:54 -0800 Cc: Richard Sandiford , Bernd Schmidt , Ulrich Weigand , GCC Patches Message-Id: <8D9ED969-8205-45E2-A6FD-3040ECF97E81@comcast.net> References: <20151028115839.1E7C85C3D@oc7340732750.ibm.com> <87ziz3ta4t.fsf@e105548-lin.cambridge.arm.com> <5630D8AE.1090608@redhat.com> <87h9l4v2pi.fsf@e105548-lin.cambridge.arm.com> <87611kuzz4.fsf@e105548-lin.cambridge.arm.com> <871tc8unnx.fsf@e105548-lin.cambridge.arm.com> <87wptztqpx.fsf@e105548-lin.cambridge.arm.com> <29C8CB44-A0EC-4A9A-A4D3-3ABB6D66DA5B@comcast.net> <7ADD4B03-BF3E-48BA-8028-AC5EB50E773C@comcast.net> <8AEB7496-7440-4239-95E9-272C6EF2AB70@comcast.net> <87mvuttrnz.fsf@e105548-lin.cambridge.arm.com> <721A5B44-82AC-4D72-9E50-500D5E5A7EC5@comcast.net> To: Richard Biener X-IsSubscribed: yes On Nov 5, 2015, at 4:32 AM, Richard Biener wrote: > No idea on location lists but maybe this means we should just use the > maximum supported integer mode for CONST_WIDE_INTs? Ah, yeah, that sounds like a fine idea. Below is that version. I snuck in one more change, as it was annoying me, and it is a regression from gcc-4.8. It has this effect: @@ -55,7 +55,7 @@ test: .long 0x72 # DW_AT_type .byte 0x10 .quad 0 # DW_AT_const_value - .quad 0x8000000000000000 # (null) + .quad 0x8000000000000000 # .byte 0 # end of children of DIE 0x2d .uleb128 0x4 # (DIE (0x6b) DW_TAG_base_type) .byte 0x10 # DW_AT_byte_size This version has the added benefit of reducing all wide_ints to be so shortened. We do this by changing get_full_len, which changes the world. If there are no substantial reasons to not check it in now, I’d like to proceed and get it checked in. People can refine it further in tree if they want. Any objections? Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 229720) +++ dwarf2out.c (working copy) @@ -368,12 +368,14 @@ #endif /* Get the number of HOST_WIDE_INTs needed to represent the precision - of the number. */ + of the number. Some constants have a large uniform precision, so + we get the precision needed for the actual value of the number. */ static unsigned int get_full_len (const wide_int &op) { - return ((op.get_precision () + HOST_BITS_PER_WIDE_INT - 1) + int prec = wi::min_precision (op, UNSIGNED); + return ((prec + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT); } @@ -9010,7 +9012,7 @@ { dw2_asm_output_data (l, a->dw_attr_val.v.val_wide->elt (i), "%s", name); - name = NULL; + name = ""; } else for (i = 0; i < len; ++i) @@ -9017,7 +9019,7 @@ { dw2_asm_output_data (l, a->dw_attr_val.v.val_wide->elt (i), "%s", name); - name = NULL; + name = ""; } } break; @@ -15593,8 +15595,13 @@ return true; case CONST_WIDE_INT: - add_AT_wide (die, DW_AT_const_value, - std::make_pair (rtl, GET_MODE (rtl))); + { + wide_int w1 = std::make_pair (rtl, MAX_MODE_INT); + unsigned int prec = MIN (wi::min_precision (w1, UNSIGNED), + (unsigned int)CONST_WIDE_INT_NUNITS (rtl) * HOST_BITS_PER_WIDE_INT); + wide_int w = wi::zext (w1, prec); + add_AT_wide (die, DW_AT_const_value, w); + } return true; case CONST_DOUBLE: Index: rtl.h =================================================================== --- rtl.h (revision 229720) +++ rtl.h (working copy) @@ -2086,6 +2086,7 @@ inline unsigned int wi::int_traits ::get_precision (const rtx_mode_t &x) { + gcc_checking_assert (x.second != BLKmode && x.second != VOIDmode); return GET_MODE_PRECISION (x.second); }