mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-10 23:45:16 +01:00
Ignore gcc strict aliasing warnings on __sync_lock_test_and_set
This commit is contained in:
parent
236dc96689
commit
7f2dec46ca
|
|
@ -1011,7 +1011,12 @@ struct atomic_storage<T, 16> : atomic_storage<T, 0>
|
|||
static inline T exchange(T& dest, T value)
|
||||
{
|
||||
__atomic_thread_fence(__ATOMIC_ACQ_REL);
|
||||
// GCC has recently started thinking using this instrinsic is breaking strict aliasing rules
|
||||
// TODO: remove if this ever get fixed in GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
return std::bit_cast<T>(__sync_lock_test_and_set(reinterpret_cast<u128*>(&dest), std::bit_cast<u128>(value)));
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static inline void store(T& dest, T value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue