public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org>
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
Date: Wed,  8 Nov 2023 23:48:36 +0000 (GMT)	[thread overview]
Message-ID: <20231108234836.3F30F3858419@sourceware.org> (raw)

https://gcc.gnu.org/g:e07716aa13d7c3e81cb0ff5c5031ddcf8278b63a

commit e07716aa13d7c3e81cb0ff5c5031ddcf8278b63a
Author: Alexandre Oliva <oliva@adacore.com>
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 <initializer_list>
 #include <bits/functional_hash.h>
@@ -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

             reply	other threads:[~2023-11-08 23:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 23:48 Alexandre Oliva [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-06 22:47 Alexandre Oliva
2023-12-06 20:01 Alexandre Oliva
2023-12-06  2:31 Alexandre Oliva
2023-12-01 23:42 Alexandre Oliva
2023-11-15  2:26 Alexandre Oliva
2023-11-09  1:58 Alexandre Oliva
2023-11-08 23:48 Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231108234836.3F30F3858419@sourceware.org \
    --to=aoliva@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).