Skip to content

Commit 935ee76

Browse files
committed
opal_atomic_rmb: GCC has fixed its acquire fence barrier in its 8 release
Only force a full memory barrier for GCC releases prior to 8.1.0. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
1 parent 45a26f7 commit 935ee76

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

opal/include/opal/sys/atomic_stdc.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ static inline void opal_atomic_wmb(void)
5050

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

0 commit comments

Comments
 (0)