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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 6C7B83857434 for ; Fri, 1 Oct 2021 20:15:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6C7B83857434 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-603-fyX1yDH_NpWyvqN9waa2ew-1; Fri, 01 Oct 2021 16:15:16 -0400 X-MC-Unique: fyX1yDH_NpWyvqN9waa2ew-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D056D800053; Fri, 1 Oct 2021 20:15:15 +0000 (UTC) Received: from localhost (unknown [10.33.36.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D9211024893; Fri, 1 Oct 2021 20:15:15 +0000 (UTC) Date: Fri, 1 Oct 2021 21:15:14 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Restore printing of assertion messages [PR102100] Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="NnzwCNHyhjoxk5A1" Content-Disposition: inline X-Spam-Status: No, score=-13.8 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_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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: Fri, 01 Oct 2021 20:15:19 -0000 --NnzwCNHyhjoxk5A1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline My changes for PR 101429 broke the _-replacement_assert function, because we now always just abort without printing anything. That's because I added checks for _GLIBCXX_HOSTED and _GLIBCXX_VERBOSE, but the checks are done before those get defined. This adds a new macro which is set by the sed command in include/Makefile, once the HOSTED and VERBOSE macros have been set by the configure script. libstdc++-v3/ChangeLog: PR libstdc++/102100 * include/Makefile.am (c++config.h): Define _GLIBCXX_VERBOSE_ASSERT based on configure output. * include/Makefile.in: Regenerate. * include/bits/c++config: Fix condition for verbose assertions. Tested powerpc64le-linux. Committed to trunk. --NnzwCNHyhjoxk5A1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 92936be47461b99d624b6a90a745f6cdc60d3e51 Author: Jonathan Wakely Date: Fri Oct 1 15:55:57 2021 libstdc++: Restore printing of assertion messages [PR102100] My changes for PR 101429 broke the _-replacement_assert function, because we now always just abort without printing anything. That's because I added checks for _GLIBCXX_HOSTED and _GLIBCXX_VERBOSE, but the checks are done before those get defined. This adds a new macro which is set by the sed command in include/Makefile, once the HOSTED and VERBOSE macros have been set by the configure script. libstdc++-v3/ChangeLog: PR libstdc++/102100 * include/Makefile.am (c++config.h): Define _GLIBCXX_VERBOSE_ASSERT based on configure output. * include/Makefile.in: Regenerate. * include/bits/c++config: Fix condition for verbose assertions. diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 15c0ad8dd03..5a5b5fd1d1b 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -1315,6 +1315,12 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT[ ][ ]*1[ ]*$$" \ ${CONFIG_HEADER} > /dev/null 2>&1 \ && ldbl_alt128_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT 1,' ;\ + verbose_assert='s,g,g,' ; \ + grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_HOSTED[ ][ ]*1[ ]*$$" \ + ${CONFIG_HEADER} > /dev/null 2>&1 \ + && grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_VERBOSE[ ][ ]*1[ ]*$$" \ + ${CONFIG_HEADER} > /dev/null 2>&1 \ + && verbose_assert='s,^#undef _GLIBCXX_VERBOSE_ASSERT$$,#define _GLIBCXX_VERBOSE_ASSERT 1,' ;\ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ -e "s,define _GLIBCXX_RELEASE,define _GLIBCXX_RELEASE $$release," \ -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ @@ -1326,6 +1332,7 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ -e "s,define _GLIBCXX_USE_FLOAT128,$$float128," \ -e "$$ldbl_compat" \ -e "$$ldbl_alt128_compat" \ + -e "$$verbose_assert" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \ -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \ diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 32b8957f814..69343a25533 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -506,11 +506,12 @@ namespace std # define __glibcxx_constexpr_assert(unevaluated) #endif +#undef _GLIBCXX_VERBOSE_ASSERT // Assert. #if defined(_GLIBCXX_ASSERTIONS) \ || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS) -# if _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE +# ifdef _GLIBCXX_VERBOSE_ASSERT namespace std { // Avoid the use of assert, because we're trying to keep the @@ -533,7 +534,7 @@ namespace std std::__replacement_assert(__FILE__, __LINE__, __PRETTY_FUNCTION__, \ #_Condition); \ } -# else // ! VERBOSE +# else // ! VERBOSE_ASSERT # define __glibcxx_assert_impl(_Condition) \ if (__builtin_expect(!bool(_Condition), false)) \ { \ --NnzwCNHyhjoxk5A1--