public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared
@ 2022-11-22 12:35 redi at gcc dot gnu.org
2022-11-22 13:06 ` [Bug libstdc++/107811] " jakub at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-22 12:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811
Bug ID: 107811
Summary: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9:
error: 'fast_float' has not been declared
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: build
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
Target: msp430-elf
Building for msp430-elf fails in libstdc++
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc: In
function 'std::from_chars_result
std::{anonymous}::__floating_from_chars_hex(const char*, const char*, T&)':
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:787:9:
error: 'fast_float' has not been declared
787 | = fast_float::binary_format<T>::mantissa_explicit_bits();
| ^~~~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:787:36:
error: expected primary-expression before '>' token
787 | = fast_float::binary_format<T>::mantissa_explicit_bits();
| ^
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:787:39:
error: '::mantissa_explicit_bits' has not been declared
787 | = fast_float::binary_format<T>::mantissa_explicit_bits();
| ^~~~~~~~~~~~~~~~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:790:24:
error: 'fast_float' was not declared in this scope
790 | : is_same_v<T, fast_float::floating_type_float16_t> ? 5 : 8;
| ^~~~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:790:11:
error: parse error in template argument list
790 | : is_same_v<T, fast_float::floating_type_float16_t> ? 5 : 8;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:948:30:
error: parse error in template argument list
948 | || is_same_v<T,
| ^~~~~~~~~~~~
949 |
fast_float::floating_type_bfloat16_t>)
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++17/floating_from_chars.cc:1133:24:
error: parse error in template argument list
1133 | else if constexpr (is_same_v<T,
fast_float::floating_type_bfloat16_t>)
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared
2022-11-22 12:35 [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared redi at gcc dot gnu.org
@ 2022-11-22 13:06 ` jakub at gcc dot gnu.org
2022-11-22 13:06 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-22 13:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Oops.
Does:
2022-11-22 Jakub Jelinek <jakub@redhat.com>
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.jj 2022-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<is_same_v<T, float>, uint32_t,
conditional_t<is_same_v<T, double>, uint64_t,
uint16_t>>;
+#if USE_LIB_FAST_FLOAT
constexpr int mantissa_bits
= fast_float::binary_format<T>::mantissa_explicit_bits();
constexpr int exponent_bits
= is_same_v<T, double> ? 11
: is_same_v<T, fast_float::floating_type_float16_t> ? 5 : 8;
+#else
+ constexpr int mantissa_bits = is_same_v<T, float> ? 23 : 52;
+ constexpr int exponent_bits = is_same_v<T, float> ? 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<T, float>
+#if USE_LIB_FAST_FLOAT
|| is_same_v<T,
- fast_float::floating_type_bfloat16_t>)
+ 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<T, float> || is_same_v<T, double>)
memcpy(&value, &result, sizeof(result));
+#if USE_LIB_FAST_FLOAT
else if constexpr (is_same_v<T, fast_float::floating_type_bfloat16_t>)
{
uint32_t res = uint32_t{result} << 16;
@@ -1156,6 +1165,7 @@ namespace
| ((uint32_t{result} & 0x8000) << 16));
memcpy(value.x, &res, sizeof(res));
}
+#endif
return {first, errc{}};
}
fix that?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared
2022-11-22 12:35 [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared redi at gcc dot gnu.org
2022-11-22 13:06 ` [Bug libstdc++/107811] " jakub at gcc dot gnu.org
@ 2022-11-22 13:06 ` jakub at gcc dot gnu.org
2022-11-22 13:18 ` redi at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-22 13:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared
2022-11-22 12:35 [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared redi at gcc dot gnu.org
2022-11-22 13:06 ` [Bug libstdc++/107811] " jakub at gcc dot gnu.org
2022-11-22 13:06 ` jakub at gcc dot gnu.org
@ 2022-11-22 13:18 ` redi at gcc dot gnu.org
2022-11-23 10:54 ` cvs-commit at gcc dot gnu.org
2022-11-23 10:58 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-22 13:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes it does
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared
2022-11-22 12:35 [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared redi at gcc dot gnu.org
` (2 preceding siblings ...)
2022-11-22 13:18 ` redi at gcc dot gnu.org
@ 2022-11-23 10:54 ` cvs-commit at gcc dot gnu.org
2022-11-23 10:58 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-23 10:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811
--- Comment #3 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:e6a32c12b4ef87c084d29863c79503344126d101
commit r13-4263-ge6a32c12b4ef87c084d29863c79503344126d101
Author: Jakub Jelinek <jakub@redhat.com>
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 <jakub@redhat.com>
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug libstdc++/107811] libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared
2022-11-22 12:35 [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared redi at gcc dot gnu.org
` (3 preceding siblings ...)
2022-11-23 10:54 ` cvs-commit at gcc dot gnu.org
@ 2022-11-23 10:58 ` jakub at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-23 10:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107811
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed then.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-23 10:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22 12:35 [Bug libstdc++/107811] New: libstdc++-v3/src/c++17/floating_from_chars.cc:787:9: error: 'fast_float' has not been declared redi at gcc dot gnu.org
2022-11-22 13:06 ` [Bug libstdc++/107811] " jakub at gcc dot gnu.org
2022-11-22 13:06 ` jakub at gcc dot gnu.org
2022-11-22 13:18 ` redi at gcc dot gnu.org
2022-11-23 10:54 ` cvs-commit at gcc dot gnu.org
2022-11-23 10:58 ` 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).