From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2245 invoked by alias); 4 Nov 2015 20:51:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2233 invoked by uid 89); 4 Nov 2015 20:51:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Nov 2015 20:51:01 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-23-wBr_vB_TQiK8TVenK0Fe3g-1; Wed, 04 Nov 2015 20:50:56 +0000 Received: from localhost ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Nov 2015 20:50:56 +0000 From: Richard Sandiford To: Mike Stump Mail-Followup-To: Mike Stump ,Richard Biener , Bernd Schmidt , Ulrich Weigand , GCC Patches , richard.sandiford@arm.com Cc: Richard Biener , Bernd Schmidt , Ulrich Weigand , GCC Patches Subject: Re: [ping] Fix PR debug/66728 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> Date: Wed, 04 Nov 2015 20:51:00 -0000 In-Reply-To: <8AEB7496-7440-4239-95E9-272C6EF2AB70@comcast.net> (Mike Stump's message of "Wed, 4 Nov 2015 11:35:15 -0800") Message-ID: <87mvuttrnz.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: wBr_vB_TQiK8TVenK0Fe3g-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-11/txt/msg00396.txt.bz2 Mike Stump writes: > Index: dwarf2out.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- dwarf2out.c (revision 229720) > +++ dwarf2out.c (working copy) > @@ -15593,8 +15593,13 @@ > return true; >=20=20 > case CONST_WIDE_INT: > - add_AT_wide (die, DW_AT_const_value, > - std::make_pair (rtl, GET_MODE (rtl))); > + { > + wide_int w1 =3D std::make_pair (rtl, MAX_MODE_INT); > + int prec =3D MIN (wi::min_precision (w1, UNSIGNED), > + (unsigned int)CONST_WIDE_INT_NUNITS (rtl) * HOST_BITS_PER_WIDE_INT); > + wide_int w =3D wide_int::from (w1, prec, UNSIGNED); > + add_AT_wide (die, DW_AT_const_value, w); > + } > return true; >=20=20 > case CONST_DOUBLE: Setting the precision based on CONST_WIDE_INT_NUNITS means that we might end up with two different precisions for two values of the same variable. E.g. for a 192-bit type, 1<<64 would be given a precision of 128 (because it needs two HWIs to store) but 1<<128 would be given a precision of 192 (because it needs three HWIs to store). We could then abort when comparing them for equality, since equality needs both integers to have the same precision. E.g. from same_dw_val_p: case dw_val_class_wide_int: return *v1->v.val_wide =3D=3D *v2->v.val_wide; Thanks, Richard