From b0842a3fea26f04b59959331d91b6c070804a168 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 18 Jun 2020 11:45:56 -0400 Subject: [PATCH] tell GNU gcc to not try to optimize the atom style tester tool --- unittest/formats/test_atom_styles.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index 93ff1c4b1d..e12bc5c1fc 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -22,6 +22,20 @@ #include #include +#if !defined(_FORTIFY_SOURCE) || (_FORTIFY_SOURCE == 0) +# if defined(__INTEL_COMPILER) +# define _do_nothing +# elif defined(__GNUC__) +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) +# pragma GCC optimize ("no-var-tracking-assignments","O0") +# else +# pragma GCC optimize ("no-var-tracking-assignments") +# endif +# else +# define _do_nothing +# endif +#endif + // whether to print verbose output (i.e. not capturing LAMMPS screen output). bool verbose = false;