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.129.124]) by sourceware.org (Postfix) with ESMTPS id 42BC13858435 for ; Thu, 10 Mar 2022 23:46:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 42BC13858435 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-42COw-1mOIak2IHTf09MUA-1; Thu, 10 Mar 2022 18:46:01 -0500 X-MC-Unique: 42COw-1mOIak2IHTf09MUA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 834B3801AFE; Thu, 10 Mar 2022 23:46:00 +0000 (UTC) Received: from localhost (unknown [10.33.36.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3388F78C27; Thu, 10 Mar 2022 23:45:59 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Do not use fast_float for 16-bit size_t [PR104870] Date: Thu, 10 Mar 2022 23:45:59 +0000 Message-Id: <20220310234559.1774782-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-13.3 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Mar 2022 23:46:06 -0000 Tested x86_64-linux and built on msp430-elf, pushed to trunk. -- >8 -- The preprocessor condition for using fast_float should match the one in the header, and require at least 32-bit size_t. libstdc++-v3/ChangeLog: PR libstdc++/104870 * src/c++17/floating_from_chars.cc: Check __SIZE_WIDTH__ >= 32 before using fast_float. --- 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 ba1345db3f2..ba0426b3344 100644 --- a/libstdc++-v3/src/c++17/floating_from_chars.cc +++ b/libstdc++-v3/src/c++17/floating_from_chars.cc @@ -61,7 +61,8 @@ extern "C" __ieee128 __strtoieee128(const char*, char**); #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 # define USE_LIB_FAST_FLOAT 1 # if __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ # undef USE_STRTOD_FOR_FROM_CHARS -- 2.34.1