diff --git a/Eigen/src/Core/arch/SSE/Complex.h b/Eigen/src/Core/arch/SSE/Complex.h index 8c0fd9a7f..919ed2a05 100644 --- a/Eigen/src/Core/arch/SSE/Complex.h +++ b/Eigen/src/Core/arch/SSE/Complex.h @@ -109,12 +109,9 @@ template<> EIGEN_STRONG_INLINE Packet2cf ei_pset1(const std::complex< template<> EIGEN_STRONG_INLINE std::complex ei_pfirst(const Packet2cf& a) { - union { - float res[2]; - double asDouble; - }; - _mm_store_sd(&asDouble,_mm_castps_pd(a.v)); - return *(std::complex*)res; + std::complex res; + _mm_storel_pi((__m64*)&res, a.v); + return res; } template<> EIGEN_STRONG_INLINE Packet2cf ei_preverse(const Packet2cf& a) { return Packet2cf(_mm_castpd_ps(ei_preverse(_mm_castps_pd(a.v)))); }