diff --git a/src/coreclr/gc/env/volatile.h b/src/coreclr/gc/env/volatile.h index e42c78e983b77a..0b320ebec510f6 100644 --- a/src/coreclr/gc/env/volatile.h +++ b/src/coreclr/gc/env/volatile.h @@ -90,7 +90,7 @@ // Please do not use this macro outside of this file. It is subject to change or removal without // notice. // -#define VOLATILE_MEMORY_BARRIER() asm volatile ("" : : : "memory") +#define VOLATILE_MEMORY_BARRIER() __atomic_signal_fence(__ATOMIC_SEQ_CST) #endif // HOST_ARM || HOST_ARM64 #elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE // ARM & ARM64 have a very weak memory model and very few tools to control that model. We're forced to perform a full diff --git a/src/coreclr/inc/volatile.h b/src/coreclr/inc/volatile.h index 1c97750496d74d..7cfd30c4d1ca65 100644 --- a/src/coreclr/inc/volatile.h +++ b/src/coreclr/inc/volatile.h @@ -100,7 +100,7 @@ // Please do not use this macro outside of this file. It is subject to change or removal without // notice. // -#define VOLATILE_MEMORY_BARRIER() asm volatile ("" : : : "memory") +#define VOLATILE_MEMORY_BARRIER() __atomic_signal_fence(__ATOMIC_SEQ_CST) #endif // HOST_ARM || HOST_ARM64 #elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE