From 695882934366ac6385e6733536ae4de9397fe623 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 28 Aug 2023 22:05:51 +0200 Subject: [PATCH 1/2] might help during debugging --- cmake/Compiler-GNU.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Compiler-GNU.cmake b/cmake/Compiler-GNU.cmake index d024bdc0a..a62875d05 100644 --- a/cmake/Compiler-GNU.cmake +++ b/cmake/Compiler-GNU.cmake @@ -131,6 +131,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS} -fcheck=all") set (DEBUG_FLAGS "${DEBUG_FLAGS} -fstack-protector-all") # Inserts a guard variable onto the stack frame for all functions +set (DEBUG_FLAGS "${DEBUG_FLAGS} -finit-real=snan -finit-integer=-2147483648") +# "strange" values to simplify debugging + set (DEBUG_FLAGS "${DEBUG_FLAGS} -fsanitize=undefined") # detect undefined behavior # Additional options From d7a9b76ba9b948a6cda87f09a90ce1b1188d96ed Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 21 Sep 2023 23:49:13 +0200 Subject: [PATCH 2/2] better debug for Intel LLVM compiler --- cmake/Compiler-IntelLLVM.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Compiler-IntelLLVM.cmake b/cmake/Compiler-IntelLLVM.cmake index 86c9d380c..76fc0386a 100644 --- a/cmake/Compiler-IntelLLVM.cmake +++ b/cmake/Compiler-IntelLLVM.cmake @@ -98,6 +98,9 @@ set (DEBUG_FLAGS "${DEBUG_FLAGS},uninit") set (DEBUG_FLAGS "${DEBUG_FLAGS} -fpe-all=0 -ftz") # ... capture all floating-point exceptions, need to overwrite -no-ftz +set (DEBUG_FLAGS "${DEBUG_FLAGS} -init=arrays,zero,minus_huge,snan") +# ... initialize logical to false, integer to -huge, float+complex to signaling NaN + # disable due to compiler bug https://community.intel.com/t5/Intel-Fortran-Compiler/false-positive-stand-f18-and-IEEE-SELECTED-REAL-KIND/m-p/1227336 #set (DEBUG_FLAGS "${DEBUG_FLAGS} -warn") # enables warnings ...