Skip to content

Commit

Permalink
Fix #9966: workaround a VS2022 optimisation bug (#10029)
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Sep 13, 2022
1 parent 64453cb commit 57717a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/CompileFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ macro(compile_flags)

if(MSVC)
add_compile_options(/W3)
if(MSVC_VERSION GREATER 1929)
# Starting with version 19.30, there is an optimisation bug, see #9966 for details
# This flag disables the broken optimisation to work around the bug
add_compile_options(/d2ssa-rse-)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options(
-W
Expand Down

0 comments on commit 57717a2

Please sign in to comment.