diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake index b913b5c72e09..6bbb9900f5d2 100644 --- a/Source/cmake/WebKitCompilerFlags.cmake +++ b/Source/cmake/WebKitCompilerFlags.cmake @@ -190,6 +190,16 @@ if (COMPILER_IS_GCC_OR_CLANG) WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-uninitialized) endif () + # Older GCC versions sometimes miscompile switches with that flag on. + # Observed in testMoveConditionallyFloatingPointSameArg (testmasm), turn it + # off throughout to avoid hard-to-diagnose bugs. + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + # This and later versions don't seem to exhibit the issue. + if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "14.0.1") + WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-fno-unswitch-loops) + endif () + endif () + WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-noexcept-type) # These GCC warnings produce too many false positives to be useful. We'll