Merge branch 'GNU-compiler-options' into spring-cleaning

This commit is contained in:
Martin Diehl 2021-03-26 08:55:23 +01:00
commit ac2cd832a3
1 changed files with 8 additions and 3 deletions

View File

@ -10,7 +10,7 @@ if (OPENMP)
endif ()
if (OPTIMIZATION STREQUAL "OFF")
set (OPTIMIZATION_FLAGS "-O0" )
set (OPTIMIZATION_FLAGS "-O0")
elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
set (OPTIMIZATION_FLAGS "-O2")
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
@ -117,6 +117,8 @@ set (COMPILE_FLAGS "${COMPILE_FLAGS} -ffpe-summary=all")
# Runtime debugging
set (DEBUG_FLAGS "${DEBUG_FLAGS} -ffpe-trap=invalid,zero,overflow")
# stop execution if floating point exception is detected (NaN is silent)
# Additional options
# -ffpe-trap=precision,denormal,underflow
set (DEBUG_FLAGS "${DEBUG_FLAGS} -g")
# Generate symbolic debugging information in the object file
@ -126,8 +128,11 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -fdump-core")
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fcheck=all")
# checks for (array-temps,bounds,do,mem,pointer,recursion)
# Additional options
# -ffpe-trap=precision,denormal,underflow
set (DEBUG_FLAGS "${DEBUG_FLAGS} -fstack-protector-all")
# Inserts a guard variable onto the stack frame for all functions
# Detect memory leaks
# -fsanitize=address
#------------------------------------------------------------------------------------------------
# precision settings