Skip to content

opal_atomic_rmb: GCC has fixed its acquire fence barrier in its 8 release #10118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions opal/include/opal/sys/atomic_stdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ static inline void opal_atomic_wmb(void)

static inline void opal_atomic_rmb(void)
{
# if defined(PLATFORM_ARCH_X86_64)
# if defined(PLATFORM_ARCH_X86_64) && PLATFORM_COMPILER_GNU && __GNUC__ < 8
/* work around a bug in older gcc versions (observed in gcc 6.x)
* where acquire seems to get treated as a no-op instead of being
* equivalent to __asm__ __volatile__("": : :"memory") on x86_64 */
* equivalent to __asm__ __volatile__("": : :"memory") on x86_64.
* The issue has been fixed in the GCC 8 release series:
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80640
*/
opal_atomic_mb();
# else
atomic_thread_fence(memory_order_acquire);
Expand Down