public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/114103] FAIL: 29_atomics/atomic/lock_free_aliases.cc -std=gnu++20 (test for excess errors) Date: Mon, 26 Feb 2024 10:54:30 +0000 [thread overview] Message-ID: <bug-114103-4-rM4yh9lYaR@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114103-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114103 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- We define them as: #ifdef __cpp_lib_atomic_lock_free_type_aliases # ifdef _GLIBCXX_HAVE_PLATFORM_WAIT using atomic_signed_lock_free = atomic<make_signed_t<__detail::__platform_wait_t>>; using atomic_unsigned_lock_free = atomic<make_unsigned_t<__detail::__platform_wait_t>>; # elif ATOMIC_INT_LOCK_FREE || !(ATOMIC_LONG_LOCK_FREE || ATOMIC_CHAR_LOCK_FREE) using atomic_signed_lock_free = atomic<signed int>; using atomic_unsigned_lock_free = atomic<unsigned int>; # elif ATOMIC_LONG_LOCK_FREE using atomic_signed_lock_free = atomic<signed long>; using atomic_unsigned_lock_free = atomic<unsigned long>; # elif ATOMIC_CHAR_LOCK_FREE using atomic_signed_lock_free = atomic<signed char>; using atomic_unsigned_lock_free = atomic<unsigned char>; # else # error "libstdc++ bug: no lock-free atomics but they were emitted in <version>" # endif #endif And then test them with: static_assert( std::atomic_signed_lock_free::is_always_lock_free ); static_assert( std::atomic_unsigned_lock_free::is_always_lock_free ); I assume the problem is that the ATOMIC_xxx_LOCK_FREE macros have value 1 not 2, so they're not unconditionally lock-free. Are any of the atomic integer types always lock-free for this target?
next prev parent reply other threads:[~2024-02-26 10:54 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-02-25 17:47 [Bug libstdc++/114103] New: " danglin at gcc dot gnu.org 2024-02-26 10:54 ` redi at gcc dot gnu.org [this message] 2024-02-26 10:55 ` [Bug libstdc++/114103] " redi at gcc dot gnu.org 2024-02-26 10:56 ` redi at gcc dot gnu.org 2024-02-26 12:21 ` dave.anglin at bell dot net 2024-02-26 12:22 ` redi at gcc dot gnu.org 2024-02-26 12:25 ` dave.anglin at bell dot net 2024-02-27 14:32 ` redi at gcc dot gnu.org 2024-02-27 20:49 ` dave.anglin at bell dot net 2024-02-28 1:04 ` dave.anglin at bell dot net 2024-02-28 9:31 ` redi at gcc dot gnu.org 2024-02-29 17:44 ` redi at gcc dot gnu.org 2024-03-01 22:15 ` dave.anglin at bell dot net 2024-03-01 22:35 ` redi at gcc dot gnu.org 2024-03-01 22:38 ` redi at gcc dot gnu.org 2024-03-01 22:42 ` redi at gcc dot gnu.org 2024-03-02 23:36 ` dave.anglin at bell dot net 2024-03-07 21:00 ` cvs-commit at gcc dot gnu.org 2024-03-07 21:01 ` redi at gcc dot gnu.org 2024-03-23 18:12 ` danglin at gcc dot gnu.org
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=bug-114103-4-rM4yh9lYaR@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).