diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-13 11:56:08 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-13 11:56:08 +0000 |
commit | b50483142d0fed21e3692bc066e4f01fbd3a069e (patch) | |
tree | 00fc2b0830ef2a6f8cb308542c9977fe04a44884 /gcc/fortran | |
parent | 9f9d05ad6a9041d4a9b63fb3656c9a6fe94e0838 (diff) | |
download | gcc-b50483142d0fed21e3692bc066e4f01fbd3a069e.tar.gz |
2012-06-13 Tobias Burnus <burnus@net-b.de>
PR fortran/53597
* decl.c (match_attr_spec): Only mark module variables
as SAVE_IMPLICIT for Fortran 2008 and later.
2012-06-13 Tobias Burnus <burnus@net-b.de>
PR fortran/53597
* gfortran.dg/save_4.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188506 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 02b644544a6..ffe1254a193 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2012-06-13 Tobias Burnus <burnus@net-b.de> + + PR fortran/53597 + * decl.c (match_attr_spec): Only mark module variables + as SAVE_IMPLICIT for Fortran 2008 and later. + 2012-06-08 Janus Weil <janus@gcc.gnu.org> PR fortran/52552 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index a760331eeba..26b5059cd9f 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3810,8 +3810,9 @@ match_attr_spec (void) } } - /* Module variables implicitly have the SAVE attribute. */ - if (gfc_current_state () == COMP_MODULE && !current_attr.save) + /* Since Fortran 2008 module variables implicitly have the SAVE attribute. */ + if (gfc_current_state () == COMP_MODULE && !current_attr.save + && (gfc_option.allow_std & GFC_STD_F2008) != 0) current_attr.save = SAVE_IMPLICIT; colon_seen = 1; |