[Bug fortran/52153] REAL128 gives extended precision, not quad precision

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 24 22:53:00 GMT 2018


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|NEW                         |RESOLVED
                 CC|                            |kargl at gcc dot gnu.org
            Version|4.7.0                       |4.7.1
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.4

--- Comment #12 from kargl at gcc dot gnu.org ---
I did not realize that there was a PR about this issue.
I changed gfortran behavior to give what I expected 
user want in 7-branch prior to branching

------------------------------------------------------------------------
r245255 | kargl | 2017-02-07 13:28:08 -0800 (Tue, 07 Feb 2017) | 6 lines

2017-02-04  Steven G. Kargl  <kargl@gcc.gnu.org>

        * trans-types.c (gfc_get_int_kind_from_width_isofortranen):  Choose
        REAL type with the widest precision if two (or more) have the same
        storage size.

I back ported the fix to both 5-branch (r24526) and
6-branch (r245259).  I don't have 5.xx installed, but
6, 7, and 8 give

% cat a.f90
use iso_fortran_env
real(real32)  a
real(real64)  b
real(real128) c
print *, kind(a), kind(b), kind(c)
print *, digits(a), digits(b),  digits(c)
end
% gfc6 -o z a.f90 && ./z
           4           8          16
          24          53         113
% gfc7 -o z a.f90 && ./z
           4           8          16
          24          53         113
% gfcx -o z a.f90 && ./z
           4           8          16
          24          53         113

So, I'm closing this as fixed (almost a year ago :-)


More information about the Gcc-bugs mailing list