[atomics] Avoid using GCC diagnostic ignored on 64-bit OSs

on ppc64/s390x, gcc 6.3 complains
"error: unknown option after '#pragma GCC diagnostic' kind".

This is to avoid using the option on these platforms.

R=jkummerow@chromium.org

Bug: v8:8100

Change-Id: I61e5b70038c41cb62889a36694ffcc36fa6deee9
Reviewed-on: https://chromium-review.googlesource.com/1246803
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#56273}
This commit is contained in:
Junliang Yan 2018-09-26 17:58:05 -04:00 committed by Commit Bot
parent 5f8a320ea5
commit 734626b99e

View File

@ -29,8 +29,10 @@ namespace {
// GCC/Clang helpfully warn us that using 64-bit atomics on 32-bit platforms
// can be slow. Good to know, but we don't have a choice.
#ifdef V8_TARGET_ARCH_32_BIT
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Watomic-alignment"
#endif // V8_TARGET_ARCH_32_BIT
template <typename T>
inline T ExchangeSeqCst(T* p, T value) {
@ -69,7 +71,9 @@ inline T XorSeqCst(T* p, T value) {
return __atomic_fetch_xor(p, value, __ATOMIC_SEQ_CST);
}
#ifdef V8_TARGET_ARCH_32_BIT
#pragma GCC diagnostic pop
#endif // V8_TARGET_ARCH_32_BIT
#elif V8_CC_MSVC