summaryrefslogtreecommitdiffstats
path: root/gcc/fortran
diff options
context:
space:
mode:
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-15 10:53:04 +0000
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-15 10:53:04 +0000
commit47e80b178f099819e86ada21f698b477fd52a649 (patch)
tree0ce2dd6ab88df97b2dc29e5e4fbeaba86bff6196 /gcc/fortran
parent4c5e883856f27c846276092dddba6190535432e2 (diff)
downloadppe42-gcc-47e80b178f099819e86ada21f698b477fd52a649.tar.gz
ppe42-gcc-47e80b178f099819e86ada21f698b477fd52a649.zip
2014-03-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/55207 * decl.c (match_attr_spec): Variables in the main program implicitly get the SAVE attribute in Fortran 2008. 2014-03-15 Janus Weil <janus@gcc.gnu.org> PR fortran/55207 * gfortran.dg/assumed_rank_7.f90: Explicitly deallocate variables. * gfortran.dg/c_ptr_tests_16.f90: Put into subroutine. * gfortran.dg/inline_sum_bounds_check_1.f90: Add -Wno-aggressive-loop-optimizations and remove an unused variable. * gfortran.dg/intent_optimize_1.f90: Put into subroutine. * gfortran.dg/pointer_init_9.f90: New. * gfortran.dg/volatile4.f90: Put into subroutine. * gfortran.dg/volatile6.f90: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/decl.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index ba4bdf05d98..ce4063edd06 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2014-03-15 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55207
+ * decl.c (match_attr_spec): Variables in the main program implicitly
+ get the SAVE attribute in Fortran 2008.
+
2014-03-14 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/60392
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 2d405fe9838..c7f5eed3682 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -3827,9 +3827,11 @@ match_attr_spec (void)
}
}
- /* 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)
+ /* Since Fortran 2008, variables declared in a MODULE or PROGRAM
+ implicitly have the SAVE attribute. */
+ if ((gfc_current_state () == COMP_MODULE
+ || gfc_current_state () == COMP_PROGRAM)
+ && !current_attr.save && (gfc_option.allow_std & GFC_STD_F2008) != 0)
current_attr.save = SAVE_IMPLICIT;
colon_seen = 1;
OpenPOWER on IntegriCloud