From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16970 invoked by alias); 31 May 2019 11:13:23 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 16947 invoked by uid 89); 31 May 2019 11:13:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 May 2019 11:13:19 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x4VBDHhr016734; Fri, 31 May 2019 06:13:17 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x4VBDGFJ016733; Fri, 31 May 2019 06:13:16 -0500 Date: Fri, 31 May 2019 11:13:00 -0000 From: Segher Boessenkool To: Martin Jambor Cc: Tejas Joshi , gcc@gcc.gnu.org, hubicka@ucw.cz Subject: Re: About GSOC. Message-ID: <20190531111316.GG31586@gate.crashing.org> References: <20190530213839.GF31586@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00276.txt.bz2 On Fri, May 31, 2019 at 12:11:18PM +0200, Martin Jambor wrote: > On Thu, May 30 2019, Segher Boessenkool wrote: > > On Thu, May 30, 2019 at 07:08:45PM +0200, Martin Jambor wrote: > >> Interesting, I was also puzzled for a moment. But notice that: > >> > >> int main () > >> { > >> _Float128 x = 18446744073709551617.5f128; > >> _Float128 y = __builtin_roundf128 (x); > >> } > >> > >> behaves as expected... the difference is of course the suffix pegged to > >> the literal constant (see > >> https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/Floating-Types.html). > >> > >> I would also expect GCC to use a larger type if a constant does not fit > >> into a double, but apparently that does not happen. I would have to > >> check but it is probably the right behavior according to the standard. > > > > 6.4.4.2/4: "An unsuffixed floating constant has type double." I don't > > think your suggestion would be okay? > > Sorry if I was not clear but I was definitely not suggesting that we > change this (or anything). I wrote that I was also surprised but > believed that GCC was doing the correct thing. Ah I see. Yeah it tricked me too :-) > Thanks for pointing out where exactly the standard says what has to be > done though. The text doesn't really leave room for extensions, either. Segher