aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven G. Kargl <kargls@comcast.net>2005-03-30 00:30:51 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2005-03-30 00:30:51 +0000
commit3ae9eb270ae75ceb7aa29752ef3a85210b7ab52c (patch)
tree003a9d206b4993a10d1804380e5cc1a02e1d8501 /gcc
parent15cc18411d3efef1544696e31833e93f79506cf4 (diff)
downloadgcc-3ae9eb270ae75ceb7aa29752ef3a85210b7ab52c.zip
gcc-3ae9eb270ae75ceb7aa29752ef3a85210b7ab52c.tar.gz
gcc-3ae9eb270ae75ceb7aa29752ef3a85210b7ab52c.tar.bz2
gfortran.h (option_t): Change d8, i8, r8 to flag_default_double, flag_default_integer, flag_default_real
* gfortran.h (option_t): Change d8, i8, r8 to flag_default_double, flag_default_integer, flag_default_real * invoke.texi: Update documentation * lang.opt: Remove d8, i8, r8 definitions; Add fdefault-double-8 fdefault-integer-8, and fdefault-real-8 definitions. * options.c (gfc_init_options): Set option defaults (gfc_handle_option): Handle command line options. * trans-types.c (gfc_init_kinds): Use options. From-SVN: r97221
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog11
-rw-r--r--gcc/fortran/gfortran.h7
-rw-r--r--gcc/fortran/invoke.texi36
-rw-r--r--gcc/fortran/lang.opt22
-rw-r--r--gcc/fortran/options.c18
-rw-r--r--gcc/fortran/trans-types.c21
6 files changed, 67 insertions, 48 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index ccbd3cb..bdc5649 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,14 @@
+2005-03-29 Steven G. Kargl <kargls@comcast.net>
+
+ * gfortran.h (option_t): Change d8, i8, r8 to flag_default_double,
+ flag_default_integer, flag_default_real
+ * invoke.texi: Update documentation
+ * lang.opt: Remove d8, i8, r8 definitions; Add fdefault-double-8
+ fdefault-integer-8, and fdefault-real-8 definitions.
+ * options.c (gfc_init_options): Set option defaults
+ (gfc_handle_option): Handle command line options.
+ * trans-types.c (gfc_init_kinds): Use options.
+
2005-03-29 Keith Besaw <kbesaw@us.ibm.com>
* f95-lang.c (builtin_function): Process the attrs parameter
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index b216772..60a3040 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1402,6 +1402,9 @@ typedef struct
int warn_surprising;
int warn_unused_labels;
+ int flag_default_double;
+ int flag_default_integer;
+ int flag_default_real;
int flag_dollar_ok;
int flag_underscoring;
int flag_second_underscore;
@@ -1413,9 +1416,7 @@ typedef struct
int flag_repack_arrays;
int q_kind;
- int r8;
- int i8;
- int d8;
+
int warn_std;
int allow_std;
int warn_nonstd_intrinsics;
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 376e9cc..e5b9390 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -119,7 +119,7 @@ by type. Explanations are in the following sections.
-fdollar-ok -fimplicit-none -fmax-identifier-length @gol
-std=@var{std}
-ffixed-line-length-@var{n} -ffixed-line-length-none @gol
--i8 -r8 -d8}
+-fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 }
@item Warning Options
@xref{Warning Options,,Options to Request or Suppress Warnings}.
@@ -183,6 +183,23 @@ Specify the layout used by the the source file. The free form layout
was introduced in Fortran 90. Fixed form was traditionally used in
older Fortran programs.
+@cindex option, -fdefault-double-8
+@cindex -fdefault-double-8, option
+@item -fdefault-double-8
+Set the "DOUBLE PRECISION" type to an 8 byte wide.
+
+@cindex option, -fdefault-integer-8
+@cindex -fdefault-integer-8, option
+@item -fdefault-integer-8
+Set the default integer and logical types to an 8 byte wide type.
+Do nothing if this is already the default.
+
+@cindex option, -fdefault-real-8
+@cindex -fdefault-real-8, option
+@item -fdefault-real-8
+Set the default real type to an 8 byte wide type.
+Do nothing if this is already the default.
+
@cindex -fdollar-ok option
@cindex options, -fdollar-ok
@item -fdollar-ok
@@ -233,23 +250,6 @@ Specify that no implicit typing is allowed, unless overridden by explicit
Conform to the specified standard. Allowed values for @var{std} are
@samp{gnu}, @samp{f95} and @samp{f90}.
-@cindex option, -i8
-@cindex -i8, option
-@cindex option, -r8
-@cindex -r8, option
-@cindex option, -d8
-@cindex -d8, option
-@item -i8
-@item -r8
-@item -d8
-The @option{-i8} and @option{-r8} options set the default @code{INTEGER}
-and @code{REAL} kinds to @code{KIND=8}. The @option{-d8} option is
-equivalent to specifying both @option{-i8} and @option{-r8}.
-
-When @option{-r8} is specified, the @code{DOUBLE PRECISION} kind is set
-to @code{KIND=16} if the target supports a 16 byte floating point format.
-If no such format exists, the @code{DOUBLE PRECISION} kind is unchanged.
-
@end table
@node Warning Options
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 976a2b4..bde1d75 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -69,9 +69,17 @@ Wunused-labels
F95
Warn when a label is unused
-d8
-F95 RejectNegative
-Set the default real and integer kinds to double precision
+fdefault-double-8
+F95
+Set the default double precision kind to an 8 byte wide type
+
+fdefault-integer-8
+F95
+Set the default integer kind to an 8 byte wide type
+
+fdefault-real-8
+F95
+Set the default real kind to an 8 byte wide type
fdollar-ok
F95
@@ -133,18 +141,10 @@ frepack-arrays
F95
Copy array sections into a contiguous block on procedure entry
-i8
-F95
-Set the default integer kind to double precision
-
qkind=
F95 RejectNegative Joined UInteger
-qkind=<n> Set the kind for a real with the 'q' exponent to 'n'
-r8
-F95
-Set the default real kind to double precision
-
std=f95
F95
Conform to the ISO Fortran 95 standard.
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 3596400..21fb0a8 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -57,6 +57,9 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
gfc_option.warn_surprising = 0;
gfc_option.warn_unused_labels = 0;
+ gfc_option.flag_default_double = 0;
+ gfc_option.flag_default_integer = 0;
+ gfc_option.flag_default_real = 0;
gfc_option.flag_dollar_ok = 0;
gfc_option.flag_underscoring = 1;
gfc_option.flag_second_underscore = 1;
@@ -68,9 +71,6 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
gfc_option.flag_repack_arrays = 0;
gfc_option.q_kind = gfc_default_double_kind;
- gfc_option.i8 = 0;
- gfc_option.r8 = 0;
- gfc_option.d8 = 0;
flag_argument_noalias = 2;
flag_errno_math = 0;
@@ -285,16 +285,16 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.q_kind = value;
break;
- case OPT_i8:
- gfc_option.i8 = value;
+ case OPT_fdefault_integer_8:
+ gfc_option.flag_default_integer = value;
break;
- case OPT_r8:
- gfc_option.r8 = value;
+ case OPT_fdefault_real_8:
+ gfc_option.flag_default_real = value;
break;
- case OPT_d8:
- gfc_option.d8 = value;
+ case OPT_fdefault_double_8:
+ gfc_option.flag_default_double = value;
break;
case OPT_I:
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index b64f868..11f17dd 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -187,10 +187,10 @@ gfc_init_kinds (void)
/* Choose the default integer kind. We choose 4 unless the user
directs us otherwise. */
- if (gfc_option.i8)
+ if (gfc_option.flag_default_integer)
{
if (!saw_i8)
- fatal_error ("integer kind=8 not available for -i8 option");
+ fatal_error ("integer kind=8 not available for -fdefault-integer-8 option");
gfc_default_integer_kind = 8;
}
else if (saw_i4)
@@ -199,10 +199,10 @@ gfc_init_kinds (void)
gfc_default_integer_kind = gfc_integer_kinds[i_index - 1].kind;
/* Choose the default real kind. Again, we choose 4 when possible. */
- if (gfc_option.r8)
+ if (gfc_option.flag_default_real)
{
if (!saw_r8)
- fatal_error ("real kind=8 not available for -r8 option");
+ fatal_error ("real kind=8 not available for -fdefault-real-8 option");
gfc_default_real_kind = 8;
}
else if (saw_r4)
@@ -210,9 +210,16 @@ gfc_init_kinds (void)
else
gfc_default_real_kind = gfc_real_kinds[0].kind;
- /* Choose the default double kind. If -r8 is specified, we use kind=16,
- if it's available, otherwise we do not change anything. */
- if (gfc_option.r8 && saw_r16)
+ /* Choose the default double kind. If -fdefault-real and -fdefault-double
+ are specified, we use kind=8, if it's available. If -fdefault-real is
+ specified without -fdefault-double, we use kind=16, if it's available.
+ Otherwise we do not change anything. */
+ if (gfc_option.flag_default_double && !gfc_option.flag_default_real)
+ fatal_error ("Use of -fdefault-double-8 requires -fdefault-real-8");
+
+ if (gfc_option.flag_default_real && gfc_option.flag_default_double && saw_r8)
+ gfc_default_double_kind = 8;
+ else if (gfc_option.flag_default_real && saw_r16)
gfc_default_double_kind = 16;
else if (saw_r4 && saw_r8)
gfc_default_double_kind = 8;