https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95640

--- Comment #6 from Bill Long <longb at cray dot com> ---
(In reply to kargl from comment #3)
> (In reply to Bill Long from comment #0)
> > > cat test.f90
>  
> > Gfortran: 
> > 
> > > module swap PrgEnv-intel PrgEnv-gnu
> > > gfortran test.f90
> > > ./a.out
> >      selected_real_kind(16) = 10
> > ieee_selected_real_kind(16) = 10
> > 
> > The output from gfortran is problematic because ieee_selected_real_kind
> > should not return 10.   If the users want KIND=10 (i.e. the
> > Intel-proprietary 80-bit x87 floats), then they need to use
> > selected_real_kind and not the IEEE version.
> 
> IEEE-754 permits the extended double type (See 3.7 Extended and
> extendable precisions).  I do not see in the Fortran standard that
> the output from ieee_seleted_real_kind must select binary32,
> binary64, or binary128.
> 
> That said, ieee_selected_real_kind is completely broken.
> See PR69101.  I used to have patch that fixed this PR,
> but never got around to committing it.  The patch attached
> in 69101 is not correct.


The description in the Fortran standard for IEEE_SELECTED_REAL_KIND includes
"The result has a value equal to a value of the kind type parameter of an
ISO/IEC/IEEE 60559:2011 floating-point format..." This, in practice, amounts to
binary32, 64, 128 for RADIX=2 (the default).  The 80-bit x87 format is not part
of the quoted IEEE standard.

Reply via email to