maxval on -inf and nan in Fortran
Segher Boessenkool
segher@kernel.crashing.org
Fri Feb 28 14:53:00 GMT 2020
On Thu, Feb 27, 2020 at 09:25:27PM -0800, Steve Kargl wrote:
> On Fri, Feb 28, 2020 at 01:02:28PM +0800, Jiufu Guo wrote:
> >
> > With -ffast-math -O3, this case `STOP 3` on a few platforms, e.g. ppc64le/x86.
>
> IMHO, using -ffast-math with Fortran code is never correct.
> With this option, you got exactly what you wanted.
It happens with -O2 already.
The frontend generates a MIN_EXPR (or MAX_EXPR) for this, which is
undefined for NaNs already. I think the testcase is just invalid?
Segher
More information about the Fortran
mailing list