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

            Bug ID: 95640
           Summary: gfortran ieee_selected_real_kind returns 10
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

> cat test.f90

program test
  use,intrinsic :: ieee_arithmetic

  print *, "     selected_real_kind(16) = ", selected_real_kind(16)
  print *, "ieee_selected_real_kind(16) = ", ieee_selected_real_kind(16)
end program test

Cray: 

> ftn test.f90
> ./a.out
     selected_real_kind(16) = 16
ieee_selected_real_kind(16) = 16

Intel:

> module swap PrgEnv-cray PrgEnv-intel
> ifort test.f90
> ./a.out
     selected_real_kind(16) = 16
ieee_selected_real_kind(16) = 16

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.

Reply via email to