From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96287 invoked by alias); 30 Oct 2015 08:59:24 -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 96230 invoked by uid 89); 30 Oct 2015 08:59:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f171.google.com Received: from mail-yk0-f171.google.com (HELO mail-yk0-f171.google.com) (209.85.160.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 30 Oct 2015 08:59:19 +0000 Received: by ykdr3 with SMTP id r3so69082461ykd.1 for ; Fri, 30 Oct 2015 01:59:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.107.8 with SMTP id g8mr5164043ywc.267.1446195557597; Fri, 30 Oct 2015 01:59:17 -0700 (PDT) Received: by 10.37.117.136 with HTTP; Fri, 30 Oct 2015 01:59:17 -0700 (PDT) In-Reply-To: <871tcdtz2v.fsf@e105548-lin.cambridge.arm.com> References: <87eggdu1z4.fsf@e105548-lin.cambridge.arm.com> <56323C3D.7010209@redhat.com> <871tcdtz2v.fsf@e105548-lin.cambridge.arm.com> Date: Fri, 30 Oct 2015 09:02:00 -0000 Message-ID: Subject: Re: Robustify REAL_MODE_FORMAT From: Richard Biener To: Richard Biener , Bernd Schmidt , GCC Patches , richard.sandiford@arm.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg03329.txt.bz2 On Thu, Oct 29, 2015 at 5:32 PM, Richard Sandiford wrote: > 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 >>>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) = &ibm_extended_format; > > I suppose we could return a non-const reference, but I'd rather stay > clear of returning those :-) Yes please. But SET_REAL_MODE_FORMAT (TFmode, &ibm_extended_format) would work as well. Richard. > Thanks, > Richard >