From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117212 invoked by alias); 29 Oct 2015 16:32:51 -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 117053 invoked by uid 89); 29 Oct 2015 16:32:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 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; Thu, 29 Oct 2015 16:32:47 +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-1-ERzA6nA3SxWY_FOwCy8z9Q-1; Thu, 29 Oct 2015 16:32:41 +0000 Received: from localhost ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 29 Oct 2015 16:32:40 +0000 From: Richard Sandiford To: Richard Biener Mail-Followup-To: Richard Biener ,Bernd Schmidt , , richard.sandiford@arm.com Cc: Bernd Schmidt , Subject: Re: Robustify REAL_MODE_FORMAT References: <87eggdu1z4.fsf@e105548-lin.cambridge.arm.com> <56323C3D.7010209@redhat.com> Date: Thu, 29 Oct 2015 16:33:00 -0000 In-Reply-To: (Richard Biener's message of "Thu, 29 Oct 2015 17:25:35 +0100") Message-ID: <871tcdtz2v.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: ERzA6nA3SxWY_FOwCy8z9Q-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-10/txt/msg03228.txt.bz2 Richard Biener writes: > On October 29, 2015 4:33:17 PM GMT+01:00, Bernd Schmidt > wrote: >>On 10/29/2015 04:30 PM, Richard Sandiford wrote: >>> Make sure that REAL_MODE_FORMAT aborts if it is passed an invalid >>mode, >>> rather than stepping beyond the bounds of an array. It turned out >>that >>> some code was passing non-float modes to the real.h routines. >> >>> gcc/ >>> * real.h (REAL_MODE_FORMAT): Abort if the mode isn't a >>> SCALAR_FLOAT_MODE_P. >> >>I'm assuming that the code you mention has already been fixed so that >>we=20 >>don't trigger the abort. Ok. > > Rather than the weird macro can't we turn real_mode_format to an inline > function? It needs to be an lvalue for things like: REAL_MODE_FORMAT (TFmode) =3D &ibm_extended_format; I suppose we could return a non-const reference, but I'd rather stay clear of returning those :-) Thanks, Richard