diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee2ec3a8e6ad07fdd7ec95666893d5e2854b50c4..c67a306aabc240dfd14608b9b4b70e35e2306b82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -202,6 +202,18 @@ endif()
 # Check for the minimum required versions of FairSoft and FairRoot
 check_external_stack()
 
+if(NOT CBM_TEST_MODEL)
+  set(CBM_TEST_MODEL Experimental)
+endif()
+# Special case for GCC 10.2.1 with Profiling enabled: optimization of L1 has to be disabled to avoid errors
+If((${CBM_TEST_MODEL} MATCHES Weekly OR ${CBM_TEST_MODEL} MATCHES Profile)
+   AND ${CMAKE_CXX_COMPILER_ID} MATCHES GNU
+   AND ${CMAKE_CXX_COMPILER_VERSION} MATCHES 10.2.1)
+  Message(STATUS "Detected Profiling build with GCC 10.2.1")
+  Message(STATUS "=> Disabling L1 optimization to avoid compilation errors")
+  Set(L1_NO_OPT ON CACHE BOOL "Detected Profiling build with GCC 10.2.1 => Disabling L1 opti to avoid comp. errors")
+EndIf()
+
 # Set the compiler flags
 set_compiler_flags()
 
@@ -278,10 +290,6 @@ add_subdirectory (services)
 ### Others
 Option(LARGE_TEST_STATISTIC "Run the test suite with large statistic (100 events)" OFF)
 
-if(NOT CBM_TEST_MODEL)
-  set(CBM_TEST_MODEL Experimental)
-endif()
-
 add_subdirectory (macro)
 add_subdirectory(fles)
 
diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt
index 1de14f1fc65fa9589a79f35f449218dfbbf3ae03..f2cdc2a69df550c0461db31a41a437ced696ca0a 100644
--- a/reco/L1/CMakeLists.txt
+++ b/reco/L1/CMakeLists.txt
@@ -16,7 +16,7 @@ set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}/L1Algo/utils
   ${CMAKE_CURRENT_SOURCE_DIR}/catools
   ${CMAKE_CURRENT_SOURCE_DIR}/utils
-  
+
 )
 
 set(SRCS
@@ -32,7 +32,7 @@ set(SRCS
   OffLineInterface/CbmL1GlobalTrackFinder.cxx
   OffLineInterface/CbmL1GlobalFindTracksEvents.cxx
   OffLineInterface/CbmGenerateMaterialMaps.cxx
-  
+
   CbmL1Util.cxx
   CbmL1Performance.cxx
   CbmL1MCTrack.cxx
@@ -43,7 +43,7 @@ set(SRCS
   L1Algo/utils/L1AlgoPulls.cxx
   L1Algo/utils/CaUvConverter.cxx
   L1Algo/utils/CaAlgoRandom.cxx
-  
+
   catools/CaToolsHitRecord.cxx
   catools/CaToolsMCData.cxx
   catools/CaToolsMCPoint.cxx
@@ -52,7 +52,7 @@ set(SRCS
   catools/CaToolsWindowFinder.cxx
   catools/CaToolsWFExpression.cxx
   catools/CaToolsMaterialHelper.cxx
-  
+
   qa/CbmCaInputQaBase.cxx
   qa/CbmCaInputQaMvd.cxx
   qa/CbmCaInputQaSts.cxx
@@ -71,7 +71,7 @@ set(SRCS
 set(NO_DICT_SRCS
   L1Algo/inactive/L1Event.cxx
   L1Algo/inactive/L1MCEvent.cxx
-  L1Algo/inactive/L1EventMatch.cxx  
+  L1Algo/inactive/L1EventMatch.cxx
 )
 
 set(HEADERS
@@ -120,15 +120,26 @@ Else()
   ADD_DEFINITIONS(-Wall -Wextra -Wsign-promo -Wno-pmf-conversions -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wstrict-null-sentinel -Wno-non-template-friend -Wno-parentheses) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root.
 EndIf()
 
+Option(L1_NO_OPT "Compile L1 without optimization" OFF)
+
 IF(SSE_FOUND)
-  ADD_DEFINITIONS(-DHAVE_SSE)
-  SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
-    "-msse -O3")
-  Message(STATUS "L1 will be compiled with SSE support")
+  if(L1_NO_OPT)
+    SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
+      "-msse")
+    Message(STATUS "L1 will be compiled with SSE support but without optimization")
+  else()
+    SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
+      "-msse -O3")
+    Message(STATUS "L1 will be compiled with SSE support and optimization")
+  endif()
 ELSE(SSE_FOUND)
-  Message(STATUS "L1 will be compiled without SSE support")
-  SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
-    "-O3")
+  if(L1_NO_OPT)
+    Message(STATUS "L1 will be compiled without SSE support and optimization")
+  else()
+    SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
+      "-O3")
+    Message(STATUS "L1 will be compiled without SSE support but with optimization")
+  endif()
 ENDIF(SSE_FOUND)
 
 set(LIBRARY_NAME L1)