Open HugoStrand opened 7 months ago
This is expected. -Ofast
implies -ffast-math
which in turn implies -ffinite-math-only
, i.e. it assumes that all floating point math is finite and there will never be any inf
or nan
. Therefore any instance of isnan
will simply be optimized out as false
. Generally the recommendation is to not use -ffast-math
at all, see https://simonbyrne.github.io/notes/fastmath/
This was discussed at the triqs updates meeting 2024-06-27 and the agreement was to catch -Ofast
at CMake level and refuse to build.
Description
The
nda::algorithms
test breaks when usingall
andany
when compiling nda 1.2.x at 6c71ef7 using gcc 12.2 with-Ofast
. I suspect that some loop is silently optimised away in thefold
algorithm.Steps to Reproduce
-Ofast
Actual behavior:
Versions
nda 1.2.x at 6c71ef7