From cc03c9d68354ea3fed03481de045c185ddc1fc49 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 5 Jul 2013 23:47:40 +0200 Subject: [PATCH] bug #556: workaround mingw bug with -O3 or -fipa-cp-clone --- Eigen/Core | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Eigen/Core b/Eigen/Core index 7e068cbbd..97aa581e2 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -19,6 +19,12 @@ // defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization. #include "src/Core/util/Macros.h" +// Disable the ipa-cp-clone optimization flag with MinGW 6.x or newer (enabled by default with -O3) +// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details. +#if defined(__MINGW32__) && EIGEN_GNUC_AT_LEAST(4,6) + #pragma GCC optimize ("-fno-ipa-cp-clone") +#endif + #include // this include file manages BLAS and MKL related macros