[PATCH, Fortran] Extension: AUTOMATIC/STATIC symbol attributes with -fdec-static

Fritz Reese fritzoreese@gmail.com
Wed Aug 17 11:58:00 GMT 2016


https://gcc.gnu.org/ml/fortran/2016-08/msg00077.html

Minor correction to the previously submitted patch:

On Wed, Aug 17, 2016 at 7:20 AM, Fritz Reese <fritzoreese@gmail.com> wrote:
> ...
> Note that AUTOMATIC does NOT override -fno-automatic; with the flag, a
> warning is produced for variables marked AUTOMATIC.
> ...

This statement was true for a previous version of this patch, but I
had changed the behavior and this is now incorrect. AUTOMATIC
attributes _do_ override -fno-automatic. I also submitted a slightly
older version of the patch file, which contained two errors. This
re-submission fixes these two artifacts; (1) Rename dec_static_*.for
-> dec_static-*.f90; and (2) fix a comment in the second test case:

--- a/gcc/testsuite/gfortran.dg/dec_static_2.f90
+++ b/gcc/testsuite/gfortran.dg/dec_static_2.f90
@@ -1,9 +1,7 @@
 ! { dg-do run }
 ! { dg-options "-fdec-static -fno-automatic -finit-local-zero" }
 !
-! Make sure a warning is produced when variables marked AUTOMATIC
-! cannot be automatic due to compilation with -fno-automatic, and
-! that they are in fact still saved.
+! Test STATIC and AUTOMATIC with -fno-automatic and recursive subroutines.
 !

The attached patch is the CORRECT version that I intend to commit.
Sorry for the mixup.

> Bootstraps and regtests on x86_64-redhat-linux. Questions, comments,
> and critique welcome. Ok for trunk?

---
Fritz Reese

> 08-17-2016  Fritz Reese  <fritzoreese@gmail.com>
>
>     gcc/fortran/
>         * lang.opt, invoke.texi, gfortran.texi: New flag -fdec-static.
>             * options.c (set_dec_flags): Set -fdec-static with -fdec.
>         * gfortran.h (symbol_attribute): New attribute AUTOMATIC.
>         * gfortran.h (gfc_add_automatic): New prototype.
>         * match.h (gfc_match_automatic, gfc_match_static): New functions.
>         * decl.c (gfc_match_automatic, gfc_match_static): Ditto.
>         * symbol.c (gfc_add_automatic): Ditto.
>         * decl.c (match_attr_spec): Match AUTOMATIC and STATIC decls.
>         * parse.c (decode_specification_statement, decode_statement): Ditto.
>         * resolve.c (apply_default_init_local, resolve_fl_variable_derived,
>         resolve_symbol): Support for automatic attribute.
>         * symbol.c (check_conflict, gfc_copy_attr, gfc_is_var_automatic):
>         Ditto.
>         * trans-decl.c (gfc_finish_var_decl): Ditto.
>
>     gcc/testsuite/gfortran.dg/
>         * dec_static_1.f90, dec_static_2.f90: New testcases.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dec_static.patch
Type: text/x-patch
Size: 22307 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160817/40f86ac0/attachment.bin>


More information about the Gcc-patches mailing list