From 41573506a97104e046d6dd3a6efd15bef29697ca Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 5 Nov 2018 01:14:51 +0100 Subject: [PATCH] GCC/Clang: no -ffast-math even with -fno-unsafe-math-optimizations I don't trust it. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbde95b..1d83fb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,9 +110,9 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") set(CMAKE_C_FLAGS_DEBUG "-g -D_DEBUG -O1") set(CMAKE_C_FLAGS_DEBUGALL "-g -ggdb -D_DEBUG") set(CMAKE_C_FLAGS_PROFILE "-g -ggdb -D_DEBUG -O1 -fno-omit-frame-pointer") - set(CMAKE_C_FLAGS_RELEASE "-O2 -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer") - set(CMAKE_C_FLAGS_MINSIZEREL "-Os -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer") + set(CMAKE_C_FLAGS_RELEASE "-O2 -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fomit-frame-pointer") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fno-omit-frame-pointer") + set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fno-unsafe-math-optimizations -fno-math-errno -fno-trapping-math -fomit-frame-pointer") set(CMAKE_CXX_FLAGS_DEBUGALL ${CMAKE_C_FLAGS_DEBUGALL}) set(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE})