Merge release-5-0 into master
[alexxy/gromacs.git] / cmake / gmxCFlags.cmake
index aabadfbc597db6e9ecdd19eb69ac0f3d19c95e75..1e675f72f706353d58fd6eb7cf7901bc1f67e283 100644 (file)
@@ -64,7 +64,7 @@ function(gmx_set_cmake_compiler_flags)
         # be set up elsewhere and passed to this function, but it is
         # inconvenient in CMake to pass more than one list, and such a
         # list is only used here.
-        foreach(build_type RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL)
+        foreach(build_type RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL PROFILE)
             set(GMXC_${language}FLAGS_${build_type} "${GMXC_${language}FLAGS_RELEASE}")
         endforeach()
         # Copy the flags that are only used by the real Release build
@@ -110,14 +110,12 @@ MACRO(gmx_c_flags)
         # Since 4.8 on by default. For previous version disabling is a no-op. Only disabling for Release because with assert
         # the warnings are OK.
         GMX_TEST_CFLAG(CFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CFLAGS_RELEASE_ONLY)
-        # Since gcc 4.8 strict - false postives with old gmx_fatal. TODO: Remove in master
-        GMX_TEST_CFLAG(CFLAGS_WARN_UNINIT "-Wno-maybe-uninitialized" GMXC_CFLAGS)
         if(CYGWIN)
             GMX_TEST_CFLAG(CFLAGS_WARN_SUBSCRIPT "-Wno-char-subscripts" GMXC_CFLAGS)
         endif()
         # new in gcc 4.5
         GMX_TEST_CFLAG(CFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CFLAGS_RELEASE)
-        GMX_TEST_CFLAG(CFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
+        GMX_TEST_CFLAG(CFLAGS_COPT "-funroll-all-loops"
                        GMXC_CFLAGS_RELEASE)
         GMX_TEST_CFLAG(CFLAGS_NOINLINE "-fno-inline" GMXC_CFLAGS_DEBUG)
     endif()
@@ -133,7 +131,7 @@ MACRO(gmx_c_flags)
         GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
         # new in gcc 4.5
         GMX_TEST_CXXFLAG(CXXFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CXXFLAGS_RELEASE)
-        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
+        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-funroll-all-loops"
                          GMXC_CXXFLAGS_RELEASE)
         GMX_TEST_CXXFLAG(CXXFLAGS_NOINLINE "-fno-inline" GMXC_CXXFLAGS_DEBUG)
     endif()
@@ -173,11 +171,11 @@ MACRO(gmx_c_flags)
 #2557: comparison between signed and unsigned operands
 #3280: declaration hides member ".."
 #3346: dynamic exception specifications are deprecated
-            GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346" GMXC_CFLAGS)
+#11074: Inlining inhibited by limit max-size(/max-total-size)
+#11076: To get full report use -opt-report=3 -opt-report-phase ipo (shown for previous remark)
+            GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076" GMXC_CFLAGS)
             GMX_TEST_CFLAG(CFLAGS_STDGNU "-std=gnu99" GMXC_CFLAGS)
             GMX_TEST_CFLAG(CFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CFLAGS_RELEASE)
-            #documented to be default but not set for ICC15. Gives remarks that inlining is not possible because of max-size setting
-            GMX_TEST_CFLAG(CFLAGS_INLINE "-no-inline-max-size -no-inline-max-total-size" GMXC_CFLAGS)
         else()
             if(NOT GMX_OPENMP)
                 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.99.99)
@@ -203,9 +201,8 @@ MACRO(gmx_c_flags)
 #All but the following warnings are identical for the C-compiler (see above)
 #1782: #pragma once is obsolete
 #2282: unrecognized GCC pragma
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd1782 -wd2282" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076 -wd1782 -wd2282" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CXXFLAGS_RELEASE)
-            GMX_TEST_CXXFLAG(CXXFLAGS_INLINE "-no-inline-max-size -no-inline-max-total-size" GMXC_CXXFLAGS)
         else()
             if(NOT GMX_OPENMP)
                 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.99.99)