From owner-freebsd-toolchain@FreeBSD.ORG Mon Sep 22 05:51:16 2014 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CEC7D93 for ; Mon, 22 Sep 2014 05:51:16 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CBF6EDFE for ; Mon, 22 Sep 2014 05:51:15 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::3123:1b4d:9ccf:5d38] (unknown [IPv6:2001:7b8:3a7:0:3123:1b4d:9ccf:5d38]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id ED3A3B803; Mon, 22 Sep 2014 07:51:09 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_F81B6876-05B0-4F20-A886-279FA219CE07"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Is this a compiler bug? From: Dimitry Andric In-Reply-To: <2EB3354D-0F65-4A79-A378-7F397911284A@me.com> Date: Mon, 22 Sep 2014 07:50:56 +0200 Message-Id: <8B883BB9-8A59-4197-A69D-210229F8EA86@FreeBSD.org> References: <20140922011946.GA4317@troutmask.apl.washington.edu> <670269FD-F75F-4044-8F3C-0260F58A70E2@me.com> <20140922014853.GA4469@troutmask.apl.washington.edu> <2EB3354D-0F65-4A79-A378-7F397911284A@me.com> To: Rui Paulo X-Mailer: Apple Mail (2.1878.6) Cc: freebsd-toolchain@freebsd.org, Steve Kargl X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 05:51:16 -0000 --Apple-Mail=_F81B6876-05B0-4F20-A886-279FA219CE07 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 22 Sep 2014, at 04:20, Rui Paulo wrote: > On Sep 21, 2014, at 18:48, Steve Kargl = wrote: >> On Sun, Sep 21, 2014 at 06:38:48PM -0700, Rui Paulo wrote: >>> On Sep 21, 2014, at 18:19, Steve Kargl = wrote: >>>>=20 >>>> #include >>>> #include >>>>=20 >>>> int >>>> main(void) >>>> { >>>> uint16_t i; >>>> i =3D 0x3ff0+63; printf("%x\n", i); >>>> i =3D 0x3ff1+63; printf("%x\n", i); >>>> i =3D 0x3ff2+63; printf("%x\n", i); >>>> i =3D 0x3ff3+63; printf("%x\n", i); >>>> i =3D 0x3ff4+63; printf("%x\n", i); >>>> i =3D 0x3ff4+63; printf("%x\n", i); >>>> i =3D 0x3ff6+63; printf("%x\n", i); >>>> i =3D 0x3ff7+63; printf("%x\n", i); >>>> i =3D 0x3ff8+63; printf("%x\n", i); >>>> i =3D 0x3ff9+63; printf("%x\n", i); >>>> i =3D 0x3ffa+63; printf("%x\n", i); >>>> i =3D 0x3ffb+63; printf("%x\n", i); >>>> i =3D 0x3ffc+63; printf("%x\n", i); >>>> i =3D 0x3ffd+63; printf("%x\n", i); >>>> i =3D 0x3ffe+63; printf("%x\n", i); >>>> i =3D 0x3fff+63; printf("%x\n", i); >>>> return 0; >>>> } >>>=20 >>> Looks like it. Please file a bug report with LLVM. >>>=20 >>=20 >> Unfortunately, llvm requires an account to report bugs. >=20 > I think I know what's happening: "e" is being parsed as scientific = notation. Yes, this is an unfortunate side effect of hexadecimal float notation (either in C99, or as a gcc extension [1]). -Dimitry [1] https://gcc.gnu.org/onlinedocs/gcc/Hex-Floats.html --Apple-Mail=_F81B6876-05B0-4F20-A886-279FA219CE07 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlQfuMsACgkQsF6jCi4glqOC5QCeL64bAJ76XcUVZPm3zn2GplKj rz0Anir6ua7NijYzURLGn4ooOLLrxpEJ =oDxV -----END PGP SIGNATURE----- --Apple-Mail=_F81B6876-05B0-4F20-A886-279FA219CE07--