* gfortran.h (gfc_option_t): Add flag_automatic.
* invoke.texi: Document the -fno-automatic option.
* lang.opt: Add a -fautomatic option.
* options.c (gfc_init_options): Default for -fautomatic is on.
(gfc_handle_option): Add handling of -fautomatic option.
* resolve.c (gfc_resolve): When -fno-automatic is used, mark
needed variables as SAVE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103671
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-08-31 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/20592
+ * gfortran.h (gfc_option_t): Add flag_automatic.
+ * invoke.texi: Document the -fno-automatic option.
+ * lang.opt: Add a -fautomatic option.
+ * options.c (gfc_init_options): Default for -fautomatic is on.
+ (gfc_handle_option): Add handling of -fautomatic option.
+ * resolve.c (gfc_resolve): When -fno-automatic is used, mark
+ needed variables as SAVE.
+
2005-08-27 Erik Edelmann <erik.edelmann@iki.fi>
* trans-array.c (gfc_trans_deferred_array): Fix comments.
int flag_pack_derived;
int flag_repack_arrays;
int flag_f2c;
+ int flag_automatic;
int flag_backslash;
int flag_d_lines;
@item Code Generation Options
@xref{Code Gen Options,,Options for Code Generation Conventions}.
@gccoptlist{
--ff2c -fno-underscoring -fsecond-underscore @gol
+-fno-automatic -ff2c -fno-underscoring -fsecond-underscore @gol
-fbounds-check -fmax-stack-var-size=@var{n} @gol
-fpackderived -frepack-arrays}
@end table
can figure out the other form by either removing @option{no-} or adding
it.
-
@table @gcctabopt
+@cindex @option{-fno-automatic} option
+@cindex options, @option{-fno-automatic}
+@item -fno-automatic
+@cindex SAVE statement
+@cindex statements, SAVE
+Treat each program unit as if the @code{SAVE} statement was specified for
+every local variable and array referenced in it. Does not affect common
+blocks. (Some Fortran compilers provide this option under the name
+@option{-static}.)
+
@cindex @option{-ff2c} option
@cindex options, @option{-ff2c}
@item -ff2c
F95
Warn when a label is unused
+fautomatic
+F95
+Do not treat local variables and COMMON blocks as if they were named in SAVE statements
+
fbackslash
F95
Specify that backslash in string introduces an escape character
gfc_option.flag_no_backend = 0;
gfc_option.flag_pack_derived = 0;
gfc_option.flag_repack_arrays = 0;
+ gfc_option.flag_automatic = 1;
gfc_option.flag_backslash = 1;
gfc_option.flag_d_lines = -1;
gfc_option.flag_dollar_ok = value;
break;
+ case OPT_fautomatic:
+ gfc_option.flag_automatic = value;
+ break;
+
case OPT_fbackslash:
gfc_option.flag_backslash = value;
break;
gfc_traverse_ns (ns, resolve_values);
- if (ns->save_all)
+ if (!gfc_option.flag_automatic || ns->save_all)
gfc_save_all (ns);
iter_stack = NULL;