Skip to content

Commit 99499dc

Browse files
authored
Merge pull request #1621 from aoikonomopoulos/2.46-gcc-miscompilation-workaround
[JSC] Work around GCC miscompilation in testmasm
2 parents 346db6f + be32b0f commit 99499dc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Source/cmake/WebKitCompilerFlags.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ if (COMPILER_IS_GCC_OR_CLANG)
190190
WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-uninitialized)
191191
endif ()
192192

193+
# Older GCC versions sometimes miscompile switches with that flag on.
194+
# Observed in testMoveConditionallyFloatingPointSameArg (testmasm), turn it
195+
# off throughout to avoid hard-to-diagnose bugs.
196+
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
197+
# This and later versions don't seem to exhibit the issue.
198+
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "14.0.1")
199+
WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-fno-unswitch-loops)
200+
endif ()
201+
endif ()
202+
193203
WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-noexcept-type)
194204

195205
# These GCC warnings produce too many false positives to be useful. We'll

0 commit comments

Comments
 (0)