From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 3F30F3858419; Wed, 8 Nov 2023 23:48:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F30F3858419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699487316; bh=8z/qmQfV78zfDZboEeFYLERfgK/9Z/iPZrDJtWvQTlE=; h=From:To:Subject:Date:From; b=kM69Ds0FRAg8N4EAJPmL0v3D8itbnv0LPDKuykGQfjnuSVK+PgwtVkha79QoqXNUL 8wu61iicEj4csYUNqh2Glr5Jb+Opq6JlvgbEFvVnAKrmID0NBg8/mJCYUO1ytGpGJ4 uEgAmIYyTtOgj75TJKaDbIIeEwhUrcVX/EapMbn4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] libsupc++: try cxa_thread_atexit_impl at runtime X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: b6635cb0fcea4a0e8ef1d48612426ce32af4d837 X-Git-Newrev: e07716aa13d7c3e81cb0ff5c5031ddcf8278b63a Message-Id: <20231108234836.3F30F3858419@sourceware.org> Date: Wed, 8 Nov 2023 23:48:36 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e07716aa13d7c3e81cb0ff5c5031ddcf8278b63a commit e07716aa13d7c3e81cb0ff5c5031ddcf8278b63a Author: Alexandre Oliva Date: Wed Nov 8 20:34:20 2023 -0300 libsupc++: try cxa_thread_atexit_impl at runtime Diff: --- libstdc++-v3/include/bits/stl_bvector.h | 50 ++++----------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 81b31684645..97a45582e69 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -56,6 +56,10 @@ #ifndef _STL_BVECTOR_H #define _STL_BVECTOR_H 1 +#ifndef _GLIBCXX_ALWAYS_INLINE +#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__)) +#endif + #if __cplusplus >= 201103L #include #include @@ -177,53 +181,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _Bit_type * _M_p; unsigned int _M_offset; -#if __OPTIMIZE__ && !__GLIBCXX_DISABLE_ASSUMPTIONS -// If the assumption (EXPR) fails, invoke undefined behavior, so that -// the test and the failure block gets optimized out, but the compiler -// still recalls that (expr) can be taken for granted. Use this only -// for expressions that are simple and explicit enough that the -// compiler can optimize based on them. When not optimizing, the -// expression is still compiled, but it's never executed. -#if 0 /* ??? */ && __cpp_lib_is_constant_evaluated -#define __GLIBCXX_BUILTIN_ASSUME(expr) \ - do \ - if (std::is_constant_evaluated ()) \ - static_assert(expr); \ - else if (!(expr)) \ - { \ - void **__assert_failed = 0; \ - *__assert_failed = 0; \ - __builtin_unreachable (); \ - } \ - while (0) -#else -#define __GLIBCXX_BUILTIN_ASSUME(expr) \ - do \ - if (!(expr)) \ - { \ - void **__assert_failed = 0; \ - *__assert_failed = 0; \ - __builtin_unreachable (); \ - } \ - while (0) -#endif -#else -#define __GLIBCXX_BUILTIN_ASSUME(expr) \ - (void)(false && (expr)) -#endif - - _GLIBCXX20_CONSTEXPR - bool - _M_normalized_p() const - { - return (_M_offset < unsigned(_S_word_bit)); - } - - _GLIBCXX20_CONSTEXPR + _GLIBCXX20_CONSTEXPR _GLIBCXX_ALWAYS_INLINE void _M_assume_normalized() const { - __GLIBCXX_BUILTIN_ASSUME (_M_normalized_p ()); + __attribute__ ((__assume__ (_M_offset < unsigned(_S_word_bit)))); } _GLIBCXX20_CONSTEXPR