[Bug target/121022] Suboptimal code generation for atomic_thread_fence

2025-07-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121022 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|UNCONFIRME

[Bug target/121022] Suboptimal code generation for atomic_thread_fence

2025-07-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121022 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement

[Bug target/121022] Suboptimal code generation for atomic_thread_fence

2025-07-10 Thread mmyangfl at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121022 --- Comment #1 from Yangfl --- The motivation: #include #include bool refcnt_release(atomic_int *refcnt) { int orig = atomic_fetch_sub_explicit(refcnt, 1, memory_order_release); if (orig > 1) { return false; } // atomic_thread_fe