On Fri, Jan 10, 2025 at 09:41:13PM +0000, Harald Anlauf wrote: > > There is one question to the reviewer(s), or those knowing better > than me how to handle IEEE infinity and NaN: with -Ofast, I needed > to add "-fno-finite-math-only" to the new testcase > gfortran.dg/ieee/out_of_range.f90, as the needed finiteness test > was otherwise optimized to always true and leading to a failure. > Is there a particular trick to disable a certain optimization > at the tree level to such checks? >
It's been a long time since I've looked at the collection of options that automatically are used with 'make check-fortran'. Is -Ofast one the tested options? As you have found, +-inf and NaN are incompatible with -Ofast. That is, if a user uses -Ofast, s/he is telling gfortran that the code does not encounter/generate exceptional FP values. If dejagnu uses -Ofast during testing, you have no choice but to use the -fno-finite-math-only option. -- steve