public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
@ 2023-05-21 10:02 br015 at umbiko dot net
  2023-05-24 11:16 ` [Bug libstdc++/109921] " redi at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: br015 at umbiko dot net @ 2023-05-21 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109921
           Summary: c++17/floating_from_chars.cc: compile error:
                    ‘from_chars_strtod’ was not declared in this scope
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: br015 at umbiko dot net
  Target Milestone: ---

This was observed in 13.1.0, but code is the same as git master. Line numbers
and code snippets refer to git master. 

/observed error/
Cross-compiling gcc 13.1 for a system without locales, libstdc++ fails to build
with the following error: 

>Making all in c++17
>/bin/bash ../../libtool --tag CXX --tag disable-shared   --mode=compile /home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/./gcc/xgcc -shared-libgcc -B/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/./gcc -nostdinc++ -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/src -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/src/.libs -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/libsupc++/.libs -B/home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/bin/ -B/home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/lib/ -isystem /home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/include -isystem /home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/sys-include    -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/libstdc++-v3/../libgcc -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/include/x86_64-buildroot-linux-uclibc -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/include -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/libstdc++-v3/libsupc++   -std=gnu++17 -nostdinc++ -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates  -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2  -fdiagnostics-show-location=once   -ffunction-sections -fdata-sections  -frandom-seed=floating_from_chars.lo  -fimplicit-templates -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0  -D_GNU_SOURCE -fcf-protection -mshstk -c -o floating_from_chars.lo ../../../../../libstdc++-v3/src/c++17/floating_from_chars.cc
>libtool: compile:  /home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/./gcc/xgcc -shared-libgcc -B/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/./gcc -nostdinc++ -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/src -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/src/.libs -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/libsupc++/.libs -B/home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/bin/ -B/home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/lib/ -isystem /home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/include -isystem /home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/sys-include -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/libstdc++-v3/../libgcc -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstlibtool: compile:  /home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/./gcc/xgcc -shared-libgcc -B/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/./gcc -nostdinc++ -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/src -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/src/.libs -L/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/libsupc++/.libs -B/home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/bin/ -B/home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/lib/ -isystem /home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/include -isystem /home/data/buildroot.x86_64/host/x86_64-buildroot-linux-uclibc/sys-include -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/libstdc++-v3/../libgcc -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/include/x86_64-buildroot-linux-uclibc -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/build/x86_64-buildroot-linux-uclibc/libstdc++-v3/include -I/home/data/buildroot.x86_64/build/host-gcc-final-13.1.0/libstdc++-v3/libsupc++ -std=gnu++17 -nostdinc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=floating_from_chars.lo -fimplicit-templates -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -D_GNU_SOURCE -fcf-protection -mshstk -c ../../../../../libstdc++-v3/src/c++17/floating_from_chars.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o floating_from_chars.o
>../../../../../libstdc++-v3/src/c++17/floating_from_chars.cc: In function ‘std::from_chars_result std::from_chars(const char*, const char*, _Float128&, chars_format)’:
>../../../../../libstdc++-v3/src/c++17/floating_from_chars.cc:1281:10: error: ‘from_chars_strtod’ was not declared in this scope
> 1281 |   return from_chars_strtod(first, last, value, fmt);
>      |          ^~~~~~~~~~~~~~~~~
>make[7]: *** [Makefile:587: floating_from_chars.lo] Error 1

/root cause analysis/
The symbol USE_STRTOD_FOR_FROM_CHARS is initially unknown. Since the target
system does not use locales, it will not be defined within the scope of
floating_to_chars.cc [1]:

>#if _GLIBCXX_HAVE_USELOCALE
>// FIXME: This should be reimplemented so it doesn't use strtod and newlocale.
>// That will avoid the need for any memory allocation, meaning that the
>// non-conforming errc::not_enough_memory result cannot happen.
># define USE_STRTOD_FOR_FROM_CHARS 1
>#endif

This results in code for from_chars_strtod() not being generated (lines 366 to
794) [2].

from_chars() implementation is generated either if USE_LIB_FAST_FLOAT or
USE_STRTOD_FOR_FROM_CHARS is enabled [3]. Within this section is code that
relies on USE_STRTOD_FOR_FROM_CHARS, but omits to check if the functionality is
available [4]

>#elif defined(USE_STRTOF128_FOR_FROM_CHARS)
>from_chars_result
>from_chars(const char* first, const char* last, _Float128& value,
>	   chars_format fmt) noexcept
>{
>  // fast_float doesn't support IEEE binary128 format, but we can use strtold.
>  return from_chars_strtod(first, last, value, fmt);
>}
>#endif

which results in the observed compilation error. 

/proposed change/
Check if USE_STRTOD_FOR_FROM_CHARS is set before using from_chars_strtod():

--- a/libstdc++-v3/src/c++17/floating_from_chars.cc     2023-04-26
09:09:43.000000000 +0200
+++ b/libstdc++-v3/src/c++17/floating_from_chars.cc     2023-05-19
07:56:56.754330183 +0200
@@ -1264,6 +1264,8 @@
 __attribute__((alias ("_ZSt10from_charsPKcS0_RdSt12chars_format")));
 #endif

+#if defined(USE_STRTOD_FOR_FROM_CHARS)
+// otherwise there is no from_chars_strtod
 #ifdef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT
 from_chars_result
 from_chars(const char* first, const char* last, __ieee128& value,
@@ -1282,6 +1284,8 @@
 }
 #endif

+#endif // USE_STRTOD_FOR_FROM_CHARS
+
 #endif // USE_LIB_FAST_FLOAT || USE_STRTOD_FOR_FROM_CHARS

 _GLIBCXX_END_NAMESPACE_VERSION

[1]
https://github.com/gcc-mirror/gcc/blob/7f3df8e65c71e5df01fe7fe7de577bb9ff48f37b/libstdc%2B%2B-v3/src/c%2B%2B17/floating_from_chars.cc#L53-L58
[2]
https://github.com/gcc-mirror/gcc/blob/7f3df8e65c71e5df01fe7fe7de577bb9ff48f37b/libstdc%2B%2B-v3/src/c%2B%2B17/floating_from_chars.cc#L366-L794
[3]
https://github.com/gcc-mirror/gcc/blob/7f3df8e65c71e5df01fe7fe7de577bb9ff48f37b/libstdc%2B%2B-v3/src/c%2B%2B17/floating_from_chars.cc#L1230-L1342
[4]
https://github.com/gcc-mirror/gcc/blob/7f3df8e65c71e5df01fe7fe7de577bb9ff48f37b/libstdc%2B%2B-v3/src/c%2B%2B17/floating_from_chars.cc#L1317-L1340

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
@ 2023-05-24 11:16 ` redi at gcc dot gnu.org
  2023-05-24 13:01 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-24 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-05-24
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
  2023-05-24 11:16 ` [Bug libstdc++/109921] " redi at gcc dot gnu.org
@ 2023-05-24 13:01 ` redi at gcc dot gnu.org
  2023-05-25  8:31 ` br015 at umbiko dot net
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-24 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The proposed change would result in ABI changes for some targets.

I think the correct fix is something more like this:

--- a/libstdc++-v3/src/c++17/floating_from_chars.cc
+++ b/libstdc++-v3/src/c++17/floating_from_chars.cc
@@ -64,7 +64,7 @@
 // strtold for __ieee128
 extern "C" __ieee128 __strtoieee128(const char*, char**);
 #elif __FLT128_MANT_DIG__ == 113 && __LDBL_MANT_DIG__ != 113 \
-      && defined(__GLIBC_PREREQ)
+      && defined(__GLIBC_PREREQ) && defined(USE_STRTOD_FOR_FROM_CHARS)
 #define USE_STRTOF128_FOR_FROM_CHARS 1
 extern "C" _Float128 __strtof128(const char*, char**)
   __asm ("strtof128")
@@ -77,10 +77,6 @@ extern "C" _Float128 __strtof128(const char*, char**)
 #if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 \
     && __SIZE_WIDTH__ >= 32
 # define USE_LIB_FAST_FLOAT 1
-# if __LDBL_MANT_DIG__ == __DBL_MANT_DIG__
-// No need to use strtold.
-#  undef USE_STRTOD_FOR_FROM_CHARS
-# endif
 #endif

 #if USE_LIB_FAST_FLOAT
@@ -1261,7 +1257,7 @@ from_chars_result
 from_chars(const char* first, const char* last, long double& value,
           chars_format fmt) noexcept
 {
-#if ! USE_STRTOD_FOR_FROM_CHARS
+#if __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ || !defined
USE_STRTOD_FOR_FROM_CHARS
   // Either long double is the same as double, or we can't use strtold.
   // In the latter case, this might give an incorrect result (e.g. values
   // out of range of double give an error, even if they fit in long double).
@@ -1329,13 +1325,23 @@ _ZSt10from_charsPKcS0_RDF128_St12chars_format(const
char* first,
                                              __ieee128& value,
                                              chars_format fmt) noexcept
 __attribute__((alias ("_ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format")));
-#elif defined(USE_STRTOF128_FOR_FROM_CHARS)
+#else
 from_chars_result
 from_chars(const char* first, const char* last, _Float128& value,
           chars_format fmt) noexcept
 {
+#ifdef USE_STRTOF128_FOR_FROM_CHARS
   // fast_float doesn't support IEEE binary128 format, but we can use strtold.
   return from_chars_strtod(first, last, value, fmt);
+#else
+  // Read a long double. This might give an incorrect result (e.g. values
+  // out of range of long double give an error, even if they fit in
_Float128).
+  long double ldbl_val;
+  auto res = std::from_chars(first, last, ldbl_val, fmt);
+  if (rec.ec == errc{})
+    value = ldbl_val;
+  return res;
+#endif
 }
 #endif


We should not use strtof128 unless we can use strtod.

We should not #undef USE_STRTOD_FOR_FROM_CHARS on line 82 just because we don't
need it for long double, as we might still need it for _Float128.

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
  2023-05-24 11:16 ` [Bug libstdc++/109921] " redi at gcc dot gnu.org
  2023-05-24 13:01 ` redi at gcc dot gnu.org
@ 2023-05-25  8:31 ` br015 at umbiko dot net
  2023-05-31 12:21 ` cvs-commit at gcc dot gnu.org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: br015 at umbiko dot net @ 2023-05-25  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andreas Ziegler <br015 at umbiko dot net> ---
Apart from a small typo

-+  if (rec.ec == errc{})
++  if (res.ec == errc{})

this fixes the build error.

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (2 preceding siblings ...)
  2023-05-25  8:31 ` br015 at umbiko dot net
@ 2023-05-31 12:21 ` cvs-commit at gcc dot gnu.org
  2023-05-31 12:24 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-31 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:7037e7b6e4ac41e536bdb9a2efcf546ec4d77166

commit r14-1431-g7037e7b6e4ac41e536bdb9a2efcf546ec4d77166
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu May 25 10:32:33 2023 +0100

    libstdc++: Fix preprocessor conditions for std::from_chars [PR109921]

    We use the from_chars_strtod function with __strtof128 to read a
    _Float128 value, but from_chars_strtod is not defined unless uselocale
    is available. This can lead to compilation failures for some targets,
    because we try to define the _Flaot128 overload in terms of a
    non-existing from_chars_strtod function.

    Only try to use __strtof128 if uselocale is available, otherwise
    fallback to the long double overload of std::from_chars (which might
    fallback to the double overload, which should use fast_float).

    This ensures we always define the full set of overloads, even if they
    are not always accurate for all values of the wider types.

    libstdc++-v3/ChangeLog:

            PR libstdc++/109921
            * src/c++17/floating_from_chars.cc (USE_STRTOF128_FOR_FROM_CHARS):
            Only define when USE_STRTOD_FOR_FROM_CHARS is also defined.
            (USE_STRTOD_FOR_FROM_CHARS): Do not undefine when long double is
            binary64.
            (from_chars(const char*, const char*, double&, chars_format)):
            Check __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ here.
            (from_chars(const char*, const char*, _Float128&, chars_format))
            Only use from_chars_strtod when USE_STRTOD_FOR_FROM_CHARS is
            defined, otherwise parse a long double and convert to _Float128.

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (3 preceding siblings ...)
  2023-05-31 12:21 ` cvs-commit at gcc dot gnu.org
@ 2023-05-31 12:24 ` redi at gcc dot gnu.org
  2023-05-31 19:57 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-31 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.2

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed on trunk so far.

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (4 preceding siblings ...)
  2023-05-31 12:24 ` redi at gcc dot gnu.org
@ 2023-05-31 19:57 ` cvs-commit at gcc dot gnu.org
  2023-07-19 19:53 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-31 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

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

commit r14-1451-ga239a35075ffd8b34f1db72c22998a625ff962b5
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed May 31 18:01:13 2023 +0100

    libstdc++: Fix build for targets without _Float128 [PR109921]

    My r14-1431-g7037e7b6e4ac41 change caused the _Float128 overload to be
    compiled unconditionally, by moving the USE_STRTOF128_FOR_FROM_CHARS
    check into the function body. That function should still only be
    compiled if the target actually supports _Float128.

    libstdc++-v3/ChangeLog:

            PR libstdc++/109921
            * src/c++17/floating_from_chars.cc: Check __FLT128_MANT_DIG__ is
            defined before trying to use _Float128.

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

* [Bug libstdc++/109921] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (5 preceding siblings ...)
  2023-05-31 19:57 ` cvs-commit at gcc dot gnu.org
@ 2023-07-19 19:53 ` redi at gcc dot gnu.org
  2023-07-19 22:43 ` [Bug libstdc++/109921] [13 Regression] " cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-19 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.2                        |13.3
         Depends on|                            |110077

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I want to backport this to gcc-13 but I need to fix PR 110077 first, or that
will regress on the branch.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110077
[Bug 110077] [14 regression] libstdc++-abi/abi_check FAILs on Solaris

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (6 preceding siblings ...)
  2023-07-19 19:53 ` redi at gcc dot gnu.org
@ 2023-07-19 22:43 ` cvs-commit at gcc dot gnu.org
  2023-07-19 23:31 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-19 22:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0867d30a68de68f4c809757348447bef94ef1491

commit r14-2661-g0867d30a68de68f4c809757348447bef94ef1491
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jul 19 21:15:17 2023 +0100

    libstdc++: Do not define inaccurate from_chars for _Float128 [PR110077]

    I think r14-1431-g7037e7b6e4ac41 was wrong to try to define the
    _Float128 overload unconditionally. Not all targets need it, so defining
    the lossy fallback using long double is not useful (and caused an ABI
    change on Solaris x86).

    Making the definition depend on USE_STRTOF128_FOR_FROM_CHARS again
    partially reverts the change for PR 109921, however that should still be
    fixed because the changes to make USE_STRTOF128_FOR_FROM_CHARS depend on
    USE_STRTOD_FOR_FROM_CHARS are not reverted.

    libstdc++-v3/ChangeLog:

            PR libstdc++/110077
            * src/c++17/floating_from_chars.cc (from_chars): Only define
            _Float128 overload when using __strfromf128.

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (7 preceding siblings ...)
  2023-07-19 22:43 ` [Bug libstdc++/109921] [13 Regression] " cvs-commit at gcc dot gnu.org
@ 2023-07-19 23:31 ` cvs-commit at gcc dot gnu.org
  2023-07-19 23:33 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-07-19 23:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

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

commit r13-7593-gcd2f934bb09c04e62beb8eb5421467184598983b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu May 25 10:32:33 2023 +0100

    libstdc++: Fix preprocessor conditions for std::from_chars [PR109921]

    We use the from_chars_strtod function with __strtof128 to read a
    _Float128 value, but from_chars_strtod is not defined unless uselocale
    is available. This can lead to compilation failures for some targets,
    because we try to define the _Float128 overload in terms of a
    non-existing from_chars_strtod function.

    Only try to use __strtof128 if uselocale is available and therefore we
    can use the from_chars_strtod function template.

    This is a simpler change than r14-1431-g7037e7b6e4ac41 on trunk, because
    that caused unwanted ABI regressions (PR libstdc++/110077).

    libstdc++-v3/ChangeLog:

            PR libstdc++/109921
            * src/c++17/floating_from_chars.cc (USE_STRTOF128_FOR_FROM_CHARS):
            Only define when USE_STRTOD_FOR_FROM_CHARS is also defined.
            (USE_STRTOD_FOR_FROM_CHARS): Do not undefine when long double is
            binary64.
            (from_chars(const char*, const char*, double&, chars_format)):
            Check __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ here.

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (8 preceding siblings ...)
  2023-07-19 23:31 ` cvs-commit at gcc dot gnu.org
@ 2023-07-19 23:33 ` redi at gcc dot gnu.org
  2023-07-20 11:57 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-19 23:33 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.3                        |13.2
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This should be fixed for gcc-13 now. There should be a release candidate for
GCC 13.2 in the next day or so. If possible please download the RC tarball and
test it for your target, so that if there are still problems we can fix them
for the 13.2 release.

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (9 preceding siblings ...)
  2023-07-19 23:33 ` redi at gcc dot gnu.org
@ 2023-07-20 11:57 ` redi at gcc dot gnu.org
  2023-07-21 13:04 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-20 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
A release candidate arrived:
https://gcc.gnu.org/pipermail/gcc/2023-July/242116.html

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (10 preceding siblings ...)
  2023-07-20 11:57 ` redi at gcc dot gnu.org
@ 2023-07-21 13:04 ` redi at gcc dot gnu.org
  2023-07-22  6:05 ` br015 at umbiko dot net
  2023-07-22  9:01 ` redi at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-21 13:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109921
Bug 109921 depends on bug 110077, which changed state.

Bug 110077 Summary: [14 regression] libstdc++-abi/abi_check FAILs on Solaris
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110077

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

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (11 preceding siblings ...)
  2023-07-21 13:04 ` redi at gcc dot gnu.org
@ 2023-07-22  6:05 ` br015 at umbiko dot net
  2023-07-22  9:01 ` redi at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: br015 at umbiko dot net @ 2023-07-22  6:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Andreas Ziegler <br015 at umbiko dot net> ---
Tested successfully cross-compiling for 
  x86_64-buildroot-linux-uclibc w/o locale

Regression tests successful for 
  i586-buildroot-linux-uclibc w/o locale
  aarch64-buildroot-linux-musl w/ locale

(using https://gcc.gnu.org/pub/gcc/snapshots/13.2.0-RC-20230720)

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

* [Bug libstdc++/109921] [13 Regression] c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope
  2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
                   ` (12 preceding siblings ...)
  2023-07-22  6:05 ` br015 at umbiko dot net
@ 2023-07-22  9:01 ` redi at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: redi at gcc dot gnu.org @ 2023-07-22  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Excellent, thanks for checking.

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

end of thread, other threads:[~2023-07-22  9:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-21 10:02 [Bug libstdc++/109921] New: c++17/floating_from_chars.cc: compile error: ‘from_chars_strtod’ was not declared in this scope br015 at umbiko dot net
2023-05-24 11:16 ` [Bug libstdc++/109921] " redi at gcc dot gnu.org
2023-05-24 13:01 ` redi at gcc dot gnu.org
2023-05-25  8:31 ` br015 at umbiko dot net
2023-05-31 12:21 ` cvs-commit at gcc dot gnu.org
2023-05-31 12:24 ` redi at gcc dot gnu.org
2023-05-31 19:57 ` cvs-commit at gcc dot gnu.org
2023-07-19 19:53 ` redi at gcc dot gnu.org
2023-07-19 22:43 ` [Bug libstdc++/109921] [13 Regression] " cvs-commit at gcc dot gnu.org
2023-07-19 23:31 ` cvs-commit at gcc dot gnu.org
2023-07-19 23:33 ` redi at gcc dot gnu.org
2023-07-20 11:57 ` redi at gcc dot gnu.org
2023-07-21 13:04 ` redi at gcc dot gnu.org
2023-07-22  6:05 ` br015 at umbiko dot net
2023-07-22  9:01 ` redi 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).