maxval on -inf and nan in Fortran

Jakub Jelinek jakub@redhat.com
Fri Feb 28 18:15:00 GMT 2020


On Fri, Feb 28, 2020 at 06:50:20PM +0100, Thomas Koenig wrote:
> Am 28.02.20 um 17:58 schrieb Steve Kargl:
> > Replacing MIN_EXPR/MAX_EXPR (everywhere?) would seem to
> > be a pessimization for correctly written code.
> 
> Also note the following part of changes.html for 9.2:
> 
> The MAX and MIN intrinsics are no longer guaranteed to return any
> particular value in case one of the arguments is a NaN. Note that this
> conforms to the Fortran standard and to what other Fortran compilers do.
> If there is a need to handle that case in some specific way, one needs
> to explicitly check for NaN's before calling MAX or MIN, e.g. by using
> the IEEE_IS_NAN function from the intrinsic module IEEE_ARITHMETIC.
> 
> This was discussed (and decided) at the time.

But then the tests shouldn't actually test it, or should be restricted
to targets where it will work anyway at least.

	Jakub



More information about the Gcc-patches mailing list