Document that -O3 is still a bad idea for gcc-12

This commit is contained in:
Marcus Holland-Moritz 2023-07-09 17:47:16 +02:00
parent 6fe8b393a8
commit 28d5de33e6

View File

@ -84,6 +84,7 @@ endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-fdiagnostics-color=always)
# For gcc, -O3 is *much* worse than -O2
# Update: This is still true for gcc-12
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2 -g")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2 -g")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")