re PR fortran/20592 (-fno-automatic (g77 option) is missing from gfortran.)

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.

From-SVN: r103671
This commit is contained in:
Francois-Xavier Coudert 2005-08-31 14:31:30 +02:00 committed by François-Xavier Coudert
parent c525013985
commit ee5426a488
6 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,14 @@
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.

View File

@ -1438,6 +1438,7 @@ typedef struct
int flag_pack_derived;
int flag_repack_arrays;
int flag_f2c;
int flag_automatic;
int flag_backslash;
int flag_d_lines;

View File

@ -143,7 +143,7 @@ by type. Explanations are in the following sections.
@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
@ -537,8 +537,17 @@ one of the forms is listed---the one which is not the default. You
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

View File

@ -69,6 +69,10 @@ Wunused-labels
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

View File

@ -70,6 +70,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
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;
@ -331,6 +332,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
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;

View File

@ -5053,7 +5053,7 @@ gfc_resolve (gfc_namespace * ns)
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;