New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.Before reporting a bug, please make sure that your Eigen version is up-to-date!

As the summary says the allFinite() function does not work properly with fast math enabled when building with MSVC in x64 mode (x86 works for some reason). I did not test if this is an issue on Linux / with other compilers.
A possible solution would be to use std::isfinite() (only available since c++11) or Microsofts finction _finite() (https://msdn.microsoft.com/en-us/library/sb8es7a8%28v=vs.120%29.aspx).
I attached a MSVC project with a test case for this problem (the platform defaults to Win32, so one has to switch to x64 manually).

Yes, and this is also the case with gcc. Since we now have a coefficient-wise isFinite method in the devel branch, allFinite could be implemented as a shortcut to mat.array().isFinite().all().
In order to keep vectorization, another option would be warp hasNaN into a non inline function such that the compiler cannot do aggressive optimizations:
template<typename T>
EIGEN_DONT_INLINE
bool hasNaN_helper(const T &a, const T &b)
{
return !((a.array()==b.array()).all());
}
template<typename Derived>
inline bool DenseBase<Derived>::hasNaN() const
{
typename internal::nested_eval<Derived,2>::type nested(derived());
return hasNaN_helper(nested,nested);
}

My "dont-inline" trick does not work with gcc. Perhaps we could switch off fast-math using pragmas, e.g.:
#pragma float_control(precise, on, push)
bool ret = !((a.array()==b.array()).all());
#pragma float_control(pop)
or maybe we just do nothing as it seems to be contradictory to enable fast-math while still caring about NaN...

If we have C++11 or _POSIX_C_SOURCE >= 200112L, we can use isfinite() (and isnan, accordingly). For MSVC we can use _finite(), as suggested in comment 0.
We can still warn that the result of isfinite might be undefined with fast-math enabled.

This is what I get with VS2013 and VS2015 compiled for 64bit in release and debug mode:
isnan(nan) = 1 == 0
allFinite: 1 (0 expected)
hasNaN: 0 (1 expected
isinf(inf) = 1 == 1
allFinite: 1 (0 expected)
hasNaN: 0 (1 expected)
allFinite: 1 (0 expected)
hasNaN: 0 (0 expected)
I had to change "m(3) = 0.0/0.0;" into "m(3) = std::numeric_limits<double>::quiet_NaN();" since VS2015 treats the former as constexpr and throws an error at compile time.
I looked into numext::isnan() and found out that EIGEN_HAS_CXX11_MATH is set to 0 due to __cplusplus still beeing set to 199711L. VS2015 is still not c++11 feature complete (Expression SFINAE, Attributes and Atomics in signal handlers are missing)...

Created attachment 618[details]
self-contained unit test
For the sake of completeness, here is the self-contained .cpp file I used as a basis for the new unit test. Simpler to use for testing different compilers/options.