public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows
@ 2020-04-25  7:14 sisyphus359 at gmail dot com
  2023-01-17 21:25 ` [Bug libquadmath/94756] " i.nixman at autistici dot org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: sisyphus359 at gmail dot com @ 2020-04-25  7:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94756

            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=48370&action=edit
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=87204 ) was presenting itself 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 being
mis-assigned.

Attached is a simple demo script that takes the value 1e-4941 (which is within
the first range) and does:

__float128 f1 = strtoflt128("1e-4941", NULL);
__float128 f2 = 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=87204, wrt that particular value
of 1e-4941.

Cheers,
Rob

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-05-04  7:16 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
2023-01-17 21:25 ` [Bug libquadmath/94756] " i.nixman at autistici dot org
2023-01-18 10:51 ` i.nixman at autistici dot org
2023-01-18 10:53 ` i.nixman at autistici dot org
2023-01-18 18:40 ` jakub at gcc dot gnu.org
2023-01-18 18:43 ` i.nixman at autistici dot org
2023-01-18 18:45 ` i.nixman at autistici dot org
2023-01-18 18:49 ` i.nixman at autistici dot org
2023-01-18 19:08 ` jakub at gcc dot gnu.org
2023-01-18 19:10 ` i.nixman at autistici dot org
2023-01-18 19:11 ` i.nixman at autistici dot org
2023-01-19  1:27 ` i.nixman at autistici dot org
2023-03-02 23:42 ` cvs-commit at gcc dot gnu.org
2023-03-02 23:44 ` jakub at gcc dot gnu.org
2023-03-03  8:20 ` i.nixman at autistici dot org
2023-03-05 11:18 ` i.nixman at autistici dot org
2023-03-05 11:20 ` i.nixman at autistici dot org
2023-03-05 14:30 ` i.nixman at autistici dot org
2023-03-07 10:31 ` i.nixman at autistici dot org
2023-03-19  5:30 ` cvs-commit at gcc dot gnu.org
2023-03-20 10:28 ` jakub at gcc dot gnu.org
2023-05-02 20:15 ` cvs-commit at gcc dot gnu.org
2023-05-03  9:24 ` jakub at gcc dot gnu.org
2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:16 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).