From d0205430655900121b5b8afc9b840eb2bfa3199b Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 28 Jul 2020 15:30:45 +0100 Subject: [PATCH] Set -fno-strict-aliasing to prevent gcc from breaking tons of code * Technically the code is incorrect, because the C++ spec is terrible and makes completely normal things illegal. GCC decides that a couple of % more perf is worth breaking lots of code, so instead we disable this class of "optimisation". --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a167a2ad..a08eb277c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,7 +314,7 @@ if(cmake_build_type_lower STREQUAL "release" OR endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fstrict-aliasing") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") if(ENABLE_GGP) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gline-tables-only -fno-omit-frame-pointer")