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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  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 ` i.nixman at autistici dot org
  2023-01-18 10:51 ` i.nixman at autistici dot org
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-17 21:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from niXman <i.nixman at autistici dot org> ---
unfortunately, this bug is still present on the master branch...

trying to deal with it..

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  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
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from niXman <i.nixman at autistici dot org> ---
guys, how can I add that
report(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87204) as duplicate of this
report?

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  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
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from niXman <i.nixman at autistici dot org> ---
BTW, I have fixed it for x86_64-mingw32. trying to rebuild for i686-mingw32 for
check.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (2 preceding siblings ...)
  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
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-18 18:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I can reproduce it on x86_64-linux with -m32 too:
f1: 0x0.000000014707e947d757fbf6f7p-16382
f2: 0x0.000000014707e946d257f2f674b9p-16382
but can't with -m64 nor when using glibc 2.35 strtof128 (in that case it works
fine both with -m32 and -m64):
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int
main ()
{
  char buffer[48];
  _Float128 f1 = strtof128 ("1e-4941", NULL);
  _Float128 f2 = 1e-4941F128;
  strfromf128 (buffer, 45, "%a", f1);
  printf ("f1: %s\n", buffer);
  strfromf128 (buffer, 45, "%a", f2);
  printf ("f2: %s\n", buffer);
  return 0;
}

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (3 preceding siblings ...)
  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
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from niXman <i.nixman at autistici dot org> ---
because it's MinGW specific:
> Demo strtoflt128 error with some subnormals on Windows


but another one - 87204, looks like NOT. but im unsure... will work on it too.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (4 preceding siblings ...)
  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
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from niXman <i.nixman at autistici dot org> ---
(In reply to niXman from comment #3)
> BTW, I have fixed it for x86_64-mingw32. trying to rebuild for i686-mingw32
> for check.

yeah, it's fixed.
works on x86_64 and i686 MinGW.

will check it on Linux host too for side effects...

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (5 preceding siblings ...)
  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
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 18:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from niXman <i.nixman at autistici dot org> ---
(In reply to niXman from comment #5)
> because it's MinGW specific:

I will paraphrase:
this report is for MinGW.
but another one - 87204, looks like NOT. but im unsure... will work on it too.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (6 preceding siblings ...)
  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
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-18 19:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As Joseph wrote, there were lots of strtod_l.c fixes since 2011 and most of
them weren't incorporated into libquadmath (unlike most of the math/ functions
which were updated a couple of times).
Wonder if this one isn't https://sourceware.org/bugzilla/show_bug.cgi?id=26137
which also talks about different behavior on 32-bit arches.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (7 preceding siblings ...)
  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
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from niXman <i.nixman at autistici dot org> ---
although I think these two bugs have the same cause...

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (8 preceding siblings ...)
  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
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-18 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from niXman <i.nixman at autistici dot org> ---
(In reply to Jakub Jelinek from comment #8)
> As Joseph wrote, there were lots of strtod_l.c fixes since 2011 and most of
> them weren't incorporated into libquadmath (unlike most of the math/
> functions which were updated a couple of times).
> Wonder if this one isn't
> https://sourceware.org/bugzilla/show_bug.cgi?id=26137 which also talks about
> different behavior on 32-bit arches.

got it, will look at glibc's implementation.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (9 preceding siblings ...)
  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
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-01-19  1:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from niXman <i.nixman at autistici dot org> ---
Created attachment 54301
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54301&action=edit
patch

(In reply to niXman from comment #9)
> although I think these two bugs have the same cause...

right, it was the same bug and this bug was caused by 32-bit variable overflow.

the overflow was fixed for i686-mingw-w64, x86_64-mingw-w64, and for i686 and
x86_64 linux.

Jakiub, John, could you look please on attached patch?

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (10 preceding siblings ...)
  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
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-02 23:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:df63f4162c78ef799d4ea9dec3443d5e9c51e5aa

commit r13-6427-gdf63f4162c78ef799d4ea9dec3443d5e9c51e5aa
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 3 00:40:13 2023 +0100

    libquadmath: Assorted libquadmath strtoflt128 fixes [PR87204, PR94756]

    This patch cherry-pickx 8 commits from glibc which fix various strtod_l
    bugs.  Additionally, it makes mp_limb_t 64-bit on llp64 targets like
    64-bit cygwin.

    2023-03-03  niXman  <i.nixman@autistici.org>
                Jakub Jelinek  <jakub@redhat.com>

            PR libquadmath/87204
            PR libquadmath/94756
            * printf/gmp-impl.h (mp_limb_t, mp_limb_signed_t,
BITS_PER_MP_LIMB):
            Use 64-bit limbs on LLP64 targets.
            * strtod/strtod_l.c (round_and_return): Cherry-pick glibc
            9310c284ae9 BZ #16151, 4406c41c1d6 BZ #16965 and fcd6b5ac36a
            BZ #23279 fixes.
            (____STRTOF_INTERNAL): Cherry-pick glibc b0debe14fcf BZ #23007,
            5556d30caee BZ #18247, 09555b9721d and c6aac3bf366 BZ #26137 and
            d84f25c7d87 fixes.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (11 preceding siblings ...)
  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
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-02 23:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed now on the trunk.  I'd wait a little bit with backports, though I think
the gmp-param.h change doesn't need backporting.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (12 preceding siblings ...)
  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
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-03-03  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from niXman <i.nixman at autistici dot org> ---
(In reply to Jakub Jelinek from comment #13)
> Fixed now on the trunk.  I'd wait a little bit with backports, though I
> think the gmp-param.h change doesn't need backporting.

Thank you Jakub!

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (13 preceding siblings ...)
  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
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-03-05 11:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from niXman <i.nixman at autistici dot org> ---
(In reply to Jakub Jelinek from comment #13)
> Fixed now on the trunk.  I'd wait a little bit with backports, though I
> think the gmp-param.h change doesn't need backporting.

unfortunately, the bug is still present on i686-mingw-w64.

this test has failed:

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <quadmath.h> 

int main(void) {
 __float128 f1, f2;
 char buffer0[50], buffer1[50];

 f1 = strtoflt128("1e-4941", NULL);
 f2 = 1e-4941Q;

 quadmath_snprintf(buffer0, 45, "%Qa", f1);
 printf("f1: %s\n", buffer0);

 quadmath_snprintf(buffer1, 45, "%Qa", f2);
 printf("f2: %s\n", buffer1);

 fflush(stdout);

 assert(strcmp(buffer0, buffer1) == 0);

 return 0;
}



the output:
f1: 0x0.0000000cc64f1cc4376f7da08f39p-16382
f2: 0x0.000000014707e946d257f2f674b9p-16382

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (14 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-03-05 11:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from niXman <i.nixman at autistici dot org> ---
trying to build x86_64-mingw-w64 and check...

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (15 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-03-05 14:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from niXman <i.nixman at autistici dot org> ---
(In reply to niXman from comment #15)
> (In reply to Jakub Jelinek from comment #13)
> > Fixed now on the trunk.  I'd wait a little bit with backports, though I
> > think the gmp-param.h change doesn't need backporting.
> 
> unfortunately, the bug is still present on i686-mingw-w64.
> 
> this test has failed:
> 
> #include <stdio.h>
> #include <string.h>
> #include <assert.h>
> #include <quadmath.h> 
> 
> int main(void) {
>  __float128 f1, f2;
>  char buffer0[50], buffer1[50];
> 
>  f1 = strtoflt128("1e-4941", NULL);
>  f2 = 1e-4941Q;
> 
>  quadmath_snprintf(buffer0, 45, "%Qa", f1);
>  printf("f1: %s\n", buffer0);
> 
>  quadmath_snprintf(buffer1, 45, "%Qa", f2);
>  printf("f2: %s\n", buffer1);
> 
>  fflush(stdout);
> 
>  assert(strcmp(buffer0, buffer1) == 0);
>  
>  return 0;
> }
> 
> 
> 
> the output:
> f1: 0x0.0000000cc64f1cc4376f7da08f39p-16382
> f2: 0x0.000000014707e946d257f2f674b9p-16382

im sorry, my bad.
I looked at one test code, but compiled another %)

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (16 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: i.nixman at autistici dot org @ 2023-03-07 10:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from niXman <i.nixman at autistici dot org> ---
tested on i686 and x86_64 mingw-w64 - works as expected.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (17 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-19  5:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:7d685cb42c1568f6ac017ea2503b366ec474ce0e

commit r12-9282-g7d685cb42c1568f6ac017ea2503b366ec474ce0e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 3 00:40:13 2023 +0100

    libquadmath: Assorted libquadmath strtoflt128 fixes [PR87204, PR94756]

    This patch cherry-pickx 8 commits from glibc which fix various strtod_l
    bugs.

    2023-03-03  niXman  <i.nixman@autistici.org>
                Jakub Jelinek  <jakub@redhat.com>

            PR libquadmath/87204
            PR libquadmath/94756
            * strtod/strtod_l.c (round_and_return): Cherry-pick glibc
            9310c284ae9 BZ #16151, 4406c41c1d6 BZ #16965 and fcd6b5ac36a
            BZ #23279 fixes.
            (____STRTOF_INTERNAL): Cherry-pick glibc b0debe14fcf BZ #23007,
            5556d30caee BZ #18247, 09555b9721d and c6aac3bf366 BZ #26137 and
            d84f25c7d87 fixes.

    (cherry picked from commit df63f4162c78ef799d4ea9dec3443d5e9c51e5aa)

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (18 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-20 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 12.3 too.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (19 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:9d98f84ca37a154a24f3f2b2950bfb450cbe6316

commit r11-10719-g9d98f84ca37a154a24f3f2b2950bfb450cbe6316
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 3 00:40:13 2023 +0100

    libquadmath: Assorted libquadmath strtoflt128 fixes [PR87204, PR94756]

    This patch cherry-pickx 8 commits from glibc which fix various strtod_l
    bugs.

    2023-03-03  niXman  <i.nixman@autistici.org>
                Jakub Jelinek  <jakub@redhat.com>

            PR libquadmath/87204
            PR libquadmath/94756
            * strtod/strtod_l.c (round_and_return): Cherry-pick glibc
            9310c284ae9 BZ #16151, 4406c41c1d6 BZ #16965 and fcd6b5ac36a
            BZ #23279 fixes.
            (____STRTOF_INTERNAL): Cherry-pick glibc b0debe14fcf BZ #23007,
            5556d30caee BZ #18247, 09555b9721d and c6aac3bf366 BZ #26137 and
            d84f25c7d87 fixes.

    (cherry picked from commit df63f4162c78ef799d4ea9dec3443d5e9c51e5aa)

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (20 preceding siblings ...)
  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
  23 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-03  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.4 as well.

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (21 preceding siblings ...)
  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
  23 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:964741883aedae54621992e25aac928a96b9c096

commit r10-11372-g964741883aedae54621992e25aac928a96b9c096
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Mar 3 00:40:13 2023 +0100

    libquadmath: Assorted libquadmath strtoflt128 fixes [PR87204, PR94756]

    This patch cherry-pickx 8 commits from glibc which fix various strtod_l
    bugs.

    2023-03-03  niXman  <i.nixman@autistici.org>
                Jakub Jelinek  <jakub@redhat.com>

            PR libquadmath/87204
            PR libquadmath/94756
            * strtod/strtod_l.c (round_and_return): Cherry-pick glibc
            9310c284ae9 BZ #16151, 4406c41c1d6 BZ #16965 and fcd6b5ac36a
            BZ #23279 fixes.
            (____STRTOF_INTERNAL): Cherry-pick glibc b0debe14fcf BZ #23007,
            5556d30caee BZ #18247, 09555b9721d and c6aac3bf366 BZ #26137 and
            d84f25c7d87 fixes.

    (cherry picked from commit df63f4162c78ef799d4ea9dec3443d5e9c51e5aa)

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

* [Bug libquadmath/94756] strtoflt128 assigns some subnormals incorrectly on MS Windows
  2020-04-25  7:14 [Bug libquadmath/94756] New: strtoflt128 assigns some subnormals incorrectly on MS Windows sisyphus359 at gmail dot com
                   ` (22 preceding siblings ...)
  2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
@ 2023-05-04  7:16 ` jakub at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-04  7:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.5 too.

^ 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).