Index: gcc/fortran/invoke.texi =================================================================== --- gcc/fortran/invoke.texi (revision 252892) +++ gcc/fortran/invoke.texi (working copy) @@ -120,7 +120,7 @@ by type. Explanations are in the following sectio -fd-lines-as-comments @gol -fdec -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math @gol -fdefault-double-8 -fdefault-integer-8 @gol --fdefault-real-8 -fdollar-ok -ffixed-line-length-@var{n} @gol +-fdefault-real-8 -fdefault-real-16 -fdollar-ok -ffixed-line-length-@var{n} @gol -ffixed-line-length-none -ffree-form -ffree-line-length-@var{n} @gol -ffree-line-length-none -fimplicit-none -finteger-4-integer-8 @gol -fmax-identifier-length -fmodule-private -ffixed-form -fno-range-check @gol @@ -404,6 +404,14 @@ the default width of @code{DOUBLE PRECISION} to 16 @code{-fdefault-double-8} is given, too. Unlike @option{-freal-4-real-8}, it does not promote variables with explicit kind declaration. +@item -fdefault-real-16 +@opindex @code{fdefault-real-16} +Set the default real type to a 16 byte wide type. This option also affects +the kind of non-double real constants like @code{1.0}, and does promote +the default width of @code{DOUBLE PRECISION} to 16 bytes if possible, unless +@code{-fdefault-double-8} is given. Unlike @option{-freal-4-real-16}, +it does not promote variables with explicit kind declaration. + @item -fdefault-double-8 @opindex @code{fdefault-double-8} Set the @code{DOUBLE PRECISION} type to an 8 byte wide type. Do nothing if this Index: gcc/fortran/lang.opt =================================================================== --- gcc/fortran/lang.opt (revision 252892) +++ gcc/fortran/lang.opt (working copy) @@ -460,6 +460,10 @@ fdefault-real-8 Fortran Var(flag_default_real) Set the default real kind to an 8 byte wide type. +fdefault-real-16 +Fortran Var(flag_default_real_16) +Set the default real kind to an 16 byte wide type. + fdollar-ok Fortran Var(flag_dollar_ok) Allow dollar signs in entity names. Index: gcc/fortran/trans-types.c =================================================================== --- gcc/fortran/trans-types.c (revision 252892) +++ gcc/fortran/trans-types.c (working copy) @@ -538,6 +538,14 @@ gfc_init_kinds (void) gfc_default_real_kind = 8; } + else if (flag_default_real_16) + { + if (!saw_r16) + gfc_fatal_error ("REAL(KIND=16) is not available for " + "%<-fdefault-real-16%> option"); + + gfc_default_real_kind = 16; + } else if (flag_real4_kind == 8) { if (!saw_r8) @@ -577,7 +585,7 @@ gfc_init_kinds (void) if (flag_default_real && flag_default_double && saw_r8) gfc_default_double_kind = 8; - else if (flag_default_real && saw_r16) + else if ((flag_default_real || flag_default_real_16) && saw_r16) gfc_default_double_kind = 16; else if (flag_real8_kind == 4) {