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

--- Comment #13 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Jun 12, 2020 at 04:16:53AM +0000, kargl at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95640
> 
> --- Comment #12 from kargl at gcc dot gnu.org ---
> (In reply to Bill Long from comment #11)
> > I checked with the Intel docs and the ia64 version of the compiler (what HPC
> > users use) does not support x87. 
> > 
> > Is there a gfortran compiler option to disable x87 use (i.e. REAL(10) is an
> > error), to match the other compilers?
> 
> The types are set up in trans-type.c(gfc_init_kinds).  I
> do not see an option that would disable querying for 
> long_double_type_node.  In principle, one might be able
> to define an option that prevents gfortran from see a
> long_double_type_node. This should then disable REAL(10).

I have confirmed that having an -fdisable-real10 option
could disable REAL(10) by commenting out the enumeration
of long_double_type_node, i.e.,

Index: gcc/fortran/trans-types.c
===================================================================
--- gcc/fortran/trans-types.c   (revision 280157)
+++ gcc/fortran/trans-types.c   (working copy)
@@ -451,7 +451,7 @@ gfc_init_kinds (void)
        continue;
       if (mode != TYPE_MODE (float_type_node)
            && (mode != TYPE_MODE (double_type_node))
-           && (mode != TYPE_MODE (long_double_type_node))
+//         && (mode != TYPE_MODE (long_double_type_node))
 #if defined(HAVE_TFmode) && defined(ENABLE_LIBQUADMATH_SUPPORT)
            && (mode != TFmode)
 #endif

With a bit of work, someone could do

Index: gcc/fortran/trans-types.c
===================================================================
--- gcc/fortran/trans-types.c   (revision 280157)
+++ gcc/fortran/trans-types.c   (working copy)
@@ -451,7 +451,7 @@ gfc_init_kinds (void)
        continue;
       if (mode != TYPE_MODE (float_type_node)
            && (mode != TYPE_MODE (double_type_node))
-           && (mode != TYPE_MODE (long_double_type_node))
+           && (!flag_disable_real10 || mode != TYPE_MODE
(long_double_type_node))
 #if defined(HAVE_TFmode) && defined(ENABLE_LIBQUADMATH_SUPPORT)
            && (mode != TFmode)
 #endif

Reply via email to