[Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared

2022-11-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Jakub Jelinek  ---
Fixed then.

[Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared

2022-11-23 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

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

commit r13-4263-ge6a32c12b4ef87c084d29863c79503344126d101
Author: Jakub Jelinek 
Date:   Wed Nov 23 11:53:54 2022 +0100

libstdc++: Fix libstdc++ build on some targets [PR107811]

fast_float library relies on size_t being 32-bit or larger and float/double
being IEEE single/double.  Otherwise we only use strtod/strtof.
In 3 spots I've used fast_float namespace stuff unconditionally in one
function, which breaks the build if fast_float is disabled.

2022-11-23  Jakub Jelinek  

PR libstdc++/107811
* src/c++17/floating_from_chars.cc (__floating_from_chars_hex):
Guard
fast_float uses with #if USE_LIB_FAST_FLOAT and for mantissa_bits
and
exponent_bits provide a fallback.

[Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared

2022-11-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811

--- Comment #2 from Jonathan Wakely  ---
Yes it does

[Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared

2022-11-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |13.0

[Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared

2022-11-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Oops.

Does:
2022-11-22  Jakub Jelinek  

PR libstdc++/107811
* src/c++17/floating_from_chars.cc (__floating_from_chars_hex): Guard
fast_float uses with #if USE_LIB_FAST_FLOAT and for mantissa_bits and
exponent_bits provide a fallback.

--- libstdc++-v3/src/c++17/floating_from_chars.cc.jj2022-11-08
09:54:37.533397224 +0100
+++ libstdc++-v3/src/c++17/floating_from_chars.cc   2022-11-22
14:03:10.365474110 +0100
@@ -783,11 +783,16 @@ namespace
 using uint_t = conditional_t, uint32_t,
 conditional_t, uint64_t,
   uint16_t>>;
+#if USE_LIB_FAST_FLOAT
 constexpr int mantissa_bits
   = fast_float::binary_format::mantissa_explicit_bits();
 constexpr int exponent_bits
   = is_same_v ? 11
: is_same_v ? 5 : 8;
+#else
+constexpr int mantissa_bits = is_same_v ? 23 : 52;
+constexpr int exponent_bits = is_same_v ? 8 : 11;
+#endif
 constexpr int exponent_bias = (1 << (exponent_bits - 1)) - 1;

 __glibcxx_requires_valid_range(first, last);
@@ -945,8 +950,11 @@ namespace
else if (mantissa_idx >= -4)
  {
if constexpr (is_same_v
+#if USE_LIB_FAST_FLOAT
  || is_same_v)
+  fast_float::floating_type_bfloat16_t>
+#endif
+)
  {
__glibcxx_assert(mantissa_idx == -1);
mantissa |= hexit >> 1;
@@ -1130,6 +1138,7 @@ namespace
   }
 if constexpr (is_same_v || is_same_v)
   memcpy(, , sizeof(result));
+#if USE_LIB_FAST_FLOAT
 else if constexpr (is_same_v)
   {
uint32_t res = uint32_t{result} << 16;
@@ -1156,6 +1165,7 @@ namespace
 | ((uint32_t{result} & 0x8000) << 16));
memcpy(value.x, , sizeof(res));
   }
+#endif

 return {first, errc{}};
   }

fix that?