aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2019-02-03 08:54:47 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2019-02-03 08:54:47 +0100
commit871e2e5339476ae3f7efe63a0156507fd10c73d7 (patch)
tree00600e392fa5e257b34fbb6a559638d550b0e51f /Eigen
parente7b481ea7460e29e7cefd2d5c5bf527e163bb7f7 (diff)
bug #1674: disable GCC's unsafe-math-optimizations in sin/cos vectorization (results are completely wrong otherwise)
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
index ce3f0fc68..693dd55ea 100644
--- a/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
+++ b/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h
@@ -319,6 +319,9 @@ inline float trig_reduce_huge (float xf, int *quadrant)
template<bool ComputeSine,typename Packet>
EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS
EIGEN_UNUSED
+#if EIGEN_GNUC_AT_LEAST(4,4)
+__attribute__((optimize("-fno-unsafe-math-optimizations")))
+#endif
Packet psincos_float(const Packet& _x)
{
typedef typename unpacket_traits<Packet>::integer_packet PacketI;