From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F292389852F; Sat, 25 Apr 2020 07:14:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F292389852F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587798862; bh=N6xrsncx92BIl1VPoRkBCoL3FWPs6sDZkbrlWXdqhAs=; h=From:To:Subject:Date:From; b=wQIc19v0D0V0msmpu2RO/VX/dpPYe2qfKPa4TgyQOszC69aASWP9pxgOij5ss3CNY CEAALh2A4PMm9rHZv01NLp1viDBjP3Kdjf6Kg5TwaehVlXRluzRDlB21jj1lUriAX8 PxXf1g5b8Ua4j0BNYugdNQd3l3PXGrfz4NZNcKsU= From: "sisyphus359 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows Date: Sat, 25 Apr 2020 07:14:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libquadmath X-Bugzilla-Version: 8.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sisyphus359 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2020 07:14:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94756 Bug ID: 94756 Summary: strtoflt128 assigns some subnormals incorrectly on MS Windows Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libquadmath Assignee: unassigned at gcc dot gnu.org Reporter: sisyphus359 at gmail dot com Target Milestone: --- Created attachment 48370 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D48370&action=3Dedit Demo strtoflt128 error with some subnormals on Windows Because this bug ( which could have ties to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D87204 ) was presenting itsel= f only on Windows, I originally posted it to the mingw-w64 bug tracker ( https://sourceforge.net/p/mingw-w64/bugs/728/ ). Today, the mingw-w64 developers informed me that it's a libquadmath bug that should be reported here. AFAICT, the subnormals that are being mis-assigned by strtoflt128 are those whose absolute values are in the ranges: 0x1p-16414 to 0x1.ffffffffffffffffffffp-16414 or 0x1.00000318p-16446 to 0x1.ffffffffffffp-16446 For the first of those ranges, all numbers that I tested were mis-assigned. For the latter range, approximately 19 in 20 of the values I tested were be= ing mis-assigned. Attached is a simple demo script that takes the value 1e-4941 (which is wit= hin the first range) and does: __float128 f1 =3D strtoflt128("1e-4941", NULL); __float128 f2 =3D 1e-4941Q; It then (on Windows) prints out the 2 values as: f1: 0x0.000000014707e947d757fbf6f7p-16382 f2: 0x0.000000014707e946d257f2f674b9p-16382 f2 is assigned correctly, f1 is not. It's the same result for both 32-bit and 64-bit gcc-8.3.0 (and earlier). I've seen reports showing that Cygwin is affected in the same way. On Ubuntu, I found that both f1 and f2 were being assigned correctly. Note the correlation between this output and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D87204, wrt that particular v= alue of 1e-4941. Cheers, Rob=