This patch conditionally disables the compilation of floating_to_chars.cc
on 16 bit targets, thus fixing a build failure for these targets as
the POW10_SPLIT_2 array exceeds the maximum object size.
libstdc++-v3/
PR libstdc++/100361
* include/std/charconv (to_chars): Hide the overloads for
floating-point types for 16 bit targets.
* src/c++17/floating_to_chars.cc: Don't compile for 16 bit targets.
* testsuite/20_util/to_chars/double.cc: Run this test only on
size32plus targets.
* testsuite/20_util/to_chars/float.cc: Likewise.
* testsuite/20_util/to_chars/long_double.cc: Likewise.
chars_format __fmt = chars_format::general) noexcept;
#endif
-#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64
+#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 \
+ && __SIZE_WIDTH__ >= 32
// Floating-point std::to_chars
// Overloads for float.
// This implementation crucially assumes float/double have the
// IEEE binary32/binary64 formats.
-#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64
+#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 \
+ /* And it also assumes that uint64_t POW10_SPLIT_2[3133][3] is valid. */\
+ && __SIZE_WIDTH__ >= 32
// Determine the binary format of 'long double'.
// { dg-do run { target c++17 } }
// { dg-require-effective-target ieee-floats }
+// { dg-require-effective-target size32plus }
#include <charconv>
// { dg-do run { target c++17 } }
// { dg-require-effective-target ieee-floats }
+// { dg-require-effective-target size32plus }
#include <charconv>
// { dg-xfail-run-if "Non-conforming printf (see PR98384)" { *-*-solaris* *-*-darwin* } }
// { dg-require-effective-target ieee-floats }
+// { dg-require-effective-target size32plus }
#include <charconv>