From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 94A463856624; Fri, 9 Jun 2023 12:25:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94A463856624 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686313559; bh=wKzz9C9eBWIRt3sS4SpvdQpNu2d6osK6xpGRmtQRe+Q=; h=From:To:Subject:Date:From; b=paw1Gw2jXKUNXFbk0y+Hjic27k3TNPyXb2/hrbGffvD6KYFiUnjJvEw6QCgCiFUOg ksFWGuaNxoGbwrUAxE3X/hKWAXuZ1IT8Ua3DwCI25fG1ET2FA5jevjWcrxWYeKwfgE Snw9fbZpv3QspxTK1KHjKz3Z/Khle6gWnyeXcFXg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-1651] libstdc++: Remove duplicate definition of _Float128 std::from_chars [PR110077] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 793ed718b522b15e2d758eca953feeec1979fe2c X-Git-Newrev: 00da6bcfccbc5ab13821d8dd7334dd48c22d5702 Message-Id: <20230609122559.94A463856624@sourceware.org> Date: Fri, 9 Jun 2023 12:25:59 +0000 (GMT) List-Id: https://gcc.gnu.org/g:00da6bcfccbc5ab13821d8dd7334dd48c22d5702 commit r14-1651-g00da6bcfccbc5ab13821d8dd7334dd48c22d5702 Author: Jonathan Wakely Date: Fri Jun 9 11:08:03 2023 +0100 libstdc++: Remove duplicate definition of _Float128 std::from_chars [PR110077] When long double uses IEEE binary128 representation we define the _Float128 overload of std::from_chars inline in . My changes in r14-1431-g7037e7b6e4ac41 cause it to also be defined non-inline in the library, leading to an abi-check failure for (at least) sparc and aarch64. Suppress the definition in the library if long double and _Float128 have are both IEEE binary128. libstdc++-v3/ChangeLog: PR libstdc++/110077 * src/c++17/floating_from_chars.cc (from_chars) <_Float128>: Only define if _Float128 and long double have different representations. Diff: --- libstdc++-v3/src/c++17/floating_from_chars.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/src/c++17/floating_from_chars.cc b/libstdc++-v3/src/c++17/floating_from_chars.cc index f1dd1037bf3..3152d64c67c 100644 --- a/libstdc++-v3/src/c++17/floating_from_chars.cc +++ b/libstdc++-v3/src/c++17/floating_from_chars.cc @@ -1325,7 +1325,8 @@ _ZSt10from_charsPKcS0_RDF128_St12chars_format(const char* first, __ieee128& value, chars_format fmt) noexcept __attribute__((alias ("_ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format"))); -#elif defined(__FLT128_MANT_DIG__) +#elif __FLT128_MANT_DIG__ == 113 && __LDBL_MANT_DIG__ != 113 +// Overload for _Float128 is not defined inline in , define it here. from_chars_result from_chars(const char* first, const char* last, _Float128& value, chars_format fmt) noexcept