Commit 734626b9 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

[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/1246803Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#56273}
parent 5f8a320e
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment