From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id C8201385DC31 for ; Wed, 19 Jul 2023 22:44:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8201385DC31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689806685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZaT/kPNWdZwtOsBbCticPgoMxhmhgsSG2KB/4Teqs18=; b=c2qCsrPS8KKs1j0Q3uNyckc58wW1wbVm6sKAIJP0JwbHugxEamXK/9dBkbIBhdJ5r7rDjQ XrpJ/hkhTD85tSTqDPNp+2P4cHD0EKJSPzFQI4IdnLuC7U4rSOnRJ2D2SFEkqwSz16y6kv NhKGt9LNbE6tgnrM+wvTemC0y6jkAOU= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-356-5nZCTq-VPWyYSStotFDU9g-1; Wed, 19 Jul 2023 18:44:42 -0400 X-MC-Unique: 5nZCTq-VPWyYSStotFDU9g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4DE33C0FC88; Wed, 19 Jul 2023 22:44:41 +0000 (UTC) Received: from localhost (unknown [10.42.28.140]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB179200B41D; Wed, 19 Jul 2023 22:44:41 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Do not define inaccurate from_chars for _Float128 [PR110077] Date: Wed, 19 Jul 2023 23:43:19 +0100 Message-ID: <20230719224441.2599589-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-linux and sparc-solaris. Pushed to trunk. -- >8 -- I think r14-1431-g7037e7b6e4ac41 was wrong to try to define the _Float128 overload unconditionally. Not all targets need it, so defining the lossy fallback using long double is not useful (and caused an ABI change on Solaris x86). Making the definition depend on USE_STRTOF128_FOR_FROM_CHARS again partially reverts the change for PR 109921, however that should still be fixed because the changes to make USE_STRTOF128_FOR_FROM_CHARS depend on USE_STRTOD_FOR_FROM_CHARS are not reverted. libstdc++-v3/ChangeLog: PR libstdc++/110077 * src/c++17/floating_from_chars.cc (from_chars): Only define _Float128 overload when using __strfromf128. --- libstdc++-v3/src/c++17/floating_from_chars.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/libstdc++-v3/src/c++17/floating_from_chars.cc b/libstdc++-v3/src/c++17/floating_from_chars.cc index 3152d64c67c..e421c5adc3e 100644 --- a/libstdc++-v3/src/c++17/floating_from_chars.cc +++ b/libstdc++-v3/src/c++17/floating_from_chars.cc @@ -1325,24 +1325,14 @@ _ZSt10from_charsPKcS0_RDF128_St12chars_format(const char* first, __ieee128& value, chars_format fmt) noexcept __attribute__((alias ("_ZSt10from_charsPKcS0_Ru9__ieee128St12chars_format"))); -#elif __FLT128_MANT_DIG__ == 113 && __LDBL_MANT_DIG__ != 113 +#elif defined(USE_STRTOF128_FOR_FROM_CHARS) // 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 { -#ifdef USE_STRTOF128_FOR_FROM_CHARS // fast_float doesn't support IEEE binary128 format, but we can use strtold. return from_chars_strtod(first, last, value, fmt); -#else - // Read a long double. This might give an incorrect result (e.g. values - // out of range of long double give an error, even if they fit in _Float128). - long double ldbl_val; - auto res = std::from_chars(first, last, ldbl_val, fmt); - if (res.ec == errc{}) - value = ldbl_val; - return res; -#endif } #endif -- 2.41.0