From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106803 invoked by alias); 4 Nov 2015 12:15:40 -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 106794 invoked by uid 89); 4 Nov 2015 12:15:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 04 Nov 2015 12:15:38 +0000 Received: by wmff134 with SMTP id f134so39868758wmf.0 for ; Wed, 04 Nov 2015 04:15:35 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.28.22.203 with SMTP id 194mr2792288wmw.45.1446639335656; Wed, 04 Nov 2015 04:15:35 -0800 (PST) Received: by 10.28.107.207 with HTTP; Wed, 4 Nov 2015 04:15:35 -0800 (PST) In-Reply-To: <7ADD4B03-BF3E-48BA-8028-AC5EB50E773C@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> Date: Wed, 04 Nov 2015 12:15:00 -0000 Message-ID: Subject: Re: [ping] Fix PR debug/66728 From: Richard Biener To: Mike Stump Cc: Richard Sandiford , Bernd Schmidt , Ulrich Weigand , GCC Patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00332.txt.bz2 On Wed, Nov 4, 2015 at 12:57 PM, Mike Stump wrote: > On Nov 4, 2015, at 1:43 AM, Richard Biener w= rote: >> I think you should limit the effect of this patch to the dwarf2out use >> as the above doesn't make sense to me. > > Since dwarf is so special, and since other clients already do something s= ort of like this anyway, it isn=E2=80=99t unreasonable to make the client b= e responsible for picking a sensible mode, and asserting if they fail to. = This also transfers the cost of the special case code out to the one client= that needs it, and avoids that cost for all the other clients. > > The new patch is below for your consideration. > > Ok? > >> Ideally we'd have an assert that you don't create a rtx_mode_t with >> VOIDmode or BLKmode. > > Added. > >> Handling the CONST_WIDE_INT in dwarf2out.c the same as we did before >> (with CONST_DOUBLE) >> looks sensible as far of fixing a regression (I assume the diff to the >> dwarf results in essentially the >> same DWARF as what was present before wide-int). > > Yes, the dwarf is the same. > > 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,15 @@ > return true; > > case CONST_WIDE_INT: > - add_AT_wide (die, DW_AT_const_value, > - std::make_pair (rtl, GET_MODE (rtl))); > + { > + machine_mode mode =3D GET_MODE (rtl); > + if (mode =3D=3D VOIDmode) > + mode =3D mode_for_size (CONST_WIDE_INT_NUNITS (rtl) > + * HOST_BITS_PER_WIDE_INT, > + MODE_INT, 0); > + add_AT_wide (die, DW_AT_const_value, > + std::make_pair (rtl, mode)); I wonder if we'll manage to to get mode_for_size return BLKmode in case of an original mode that was not of a size multiple of HOST_BITS_PER_WIDE_INT (and that's host dependent even...). We probably should use smallest_mode_for_size on a precision derived from the value (ignore leading ones and zeros or so, exact details need to be figured out). Eventually hide this detail in a smallest_mode_for_const_wide_int () helper. > + } > return true; > > case CONST_DOUBLE: > Index: rtl.h > =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 > --- 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_assert (x.second !=3D BLKmode && x.second !=3D VOIDmode); Please use gcc_checking_assert here. Richard. > return GET_MODE_PRECISION (x.second); > } > >