-fno-automatic option (PR 20592)
François-Xavier Coudert
fxcoudert@gmail.com
Wed Aug 31 14:27:00 GMT 2005
I've been thinking about adding the -fno-automatic option to gfortran.
Apart from the documentation, the handling of the option, I came to
the conclusion that only one place in the front-end needs changing:
Index: gcc/fortran/resolve.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/resolve.c,v
retrieving revision 1.51
diff -u -3 -p -r1.51 resolve.c
--- gcc/fortran/resolve.c 10 Aug 2005 20:16:26 -0000 1.51
+++ gcc/fortran/resolve.c 31 Aug 2005 11:15:50 -0000
@@ -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;
Where flag_automatic is the new flag corresponding to the option.
Then, if it was that simple, it would have been done earlier, but even
thinking harder I can't find what's wrong with this simple patch. Can
someone help me? Is this the right thing, or did I miss an obvious
point?
FX
More information about the Fortran
mailing list