From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1006) id 1CAFB385481F; Thu, 20 May 2021 12:41:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CAFB385481F MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Joern Rennecke To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-8446] libstdc++: Disable floating_to_chars.cc on 16 bit targets X-Act-Checkin: gcc X-Git-Author: Joern Rennecke X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 271fc1caac433e84e6389e73a5bf07350ea545e2 X-Git-Newrev: 5f772bd9847cdbf6a7a6d856de87cb65472d56f4 Message-Id: <20210520124136.1CAFB385481F@sourceware.org> Date: Thu, 20 May 2021 12:41:36 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 12:41:36 -0000 https://gcc.gnu.org/g:5f772bd9847cdbf6a7a6d856de87cb65472d56f4 commit r11-8446-g5f772bd9847cdbf6a7a6d856de87cb65472d56f4 Author: Joern Rennecke Date: Thu May 20 13:21:41 2021 +0100 libstdc++: Disable floating_to_chars.cc on 16 bit targets 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. Diff: --- libstdc++-v3/include/std/charconv | 3 ++- libstdc++-v3/src/c++17/floating_to_chars.cc | 4 +++- libstdc++-v3/testsuite/20_util/to_chars/double.cc | 1 + libstdc++-v3/testsuite/20_util/to_chars/float.cc | 1 + libstdc++-v3/testsuite/20_util/to_chars/long_double.cc | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv index 6e407f31e30..64a6606bb33 100644 --- a/libstdc++-v3/include/std/charconv +++ b/libstdc++-v3/include/std/charconv @@ -703,7 +703,8 @@ namespace __detail 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. diff --git a/libstdc++-v3/src/c++17/floating_to_chars.cc b/libstdc++-v3/src/c++17/floating_to_chars.cc index 1a0abb9e80f..44f547a77b4 100644 --- a/libstdc++-v3/src/c++17/floating_to_chars.cc +++ b/libstdc++-v3/src/c++17/floating_to_chars.cc @@ -50,7 +50,9 @@ extern "C" int __sprintfieee128(char*, const char*, ...); // 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'. diff --git a/libstdc++-v3/testsuite/20_util/to_chars/double.cc b/libstdc++-v3/testsuite/20_util/to_chars/double.cc index bb6f74424ed..64e62213044 100644 --- a/libstdc++-v3/testsuite/20_util/to_chars/double.cc +++ b/libstdc++-v3/testsuite/20_util/to_chars/double.cc @@ -33,6 +33,7 @@ // { dg-do run { target c++17 } } // { dg-require-effective-target ieee-floats } +// { dg-require-effective-target size32plus } #include diff --git a/libstdc++-v3/testsuite/20_util/to_chars/float.cc b/libstdc++-v3/testsuite/20_util/to_chars/float.cc index 0c8dd4f66df..73b9081d4ff 100644 --- a/libstdc++-v3/testsuite/20_util/to_chars/float.cc +++ b/libstdc++-v3/testsuite/20_util/to_chars/float.cc @@ -33,6 +33,7 @@ // { dg-do run { target c++17 } } // { dg-require-effective-target ieee-floats } +// { dg-require-effective-target size32plus } #include diff --git a/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc b/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc index 8cf45ad5e94..447e5368811 100644 --- a/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc +++ b/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc @@ -35,6 +35,7 @@ // { dg-xfail-run-if "Non-conforming printf (see PR98384)" { *-*-solaris* *-*-darwin* } } // { dg-require-effective-target ieee-floats } +// { dg-require-effective-target size32plus } #include