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

            Bug ID: 101835
           Summary: Fortran 128-bit float support
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sandra at gcc dot gnu.org
  Target Milestone: ---

Per discussion here

https://gcc.gnu.org/pipermail/fortran/2021-August/056334.html

there seems to be some confusion in the Fortran front end re
gfc_real16_is_float128 and gfc_float128_type_node.  The C __float128 type must
correspond to an IEEE representation and that isn't being checked where those
variables are being set.  In cases where __float128 interoperability is
required, it should be using float128_type_node with some additional check to
make sure Fortran recognizes that mode (as in the patch for c_float128 and
c_float128_complex attached to the mail linked above).  In cases where all that
matters is that it's kind=16 and not the same kind as long double, it would be
less confusing to rename gfc_float128_type_node to gfc_real16_type_node.

Also, note that on PowerPC there are 3 different 128-bit float modes, and the
one that is defined to have precision 128 is the explicit IBM encoding, not
IEEE, so the check for mode_precision == 128 in gfc_build_real_type is
guaranteed not to find the __float128 equivalent on that target.  (The long
double size on that target is configurable by command-line option but I don't
know what actually makes sense from an ABI/CPU support point of view; it's at
least conceivable that it could trip over that test, though.)

Reply via email to