]> gcc.gnu.org Git - gcc.git/commitdiff
re PR fortran/55207 ([F08] Variables declared in the main program should implicitly...
authorJanus Weil <janus@gcc.gnu.org>
Tue, 18 Mar 2014 22:15:10 +0000 (23:15 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Tue, 18 Mar 2014 22:15:10 +0000 (23:15 +0100)
2014-03-18  Janus Weil  <janus@gcc.gnu.org>

PR fortran/55207
PR fortran/60549
* decl.c (match_attr_spec): Revert r208590.

2014-03-18  Janus Weil  <janus@gcc.gnu.org>

PR fortran/55207
PR fortran/60549
* gfortran.dg/assumed_rank_7.f90: Revert r208590.
* gfortran.dg/c_ptr_tests_16.f90: Ditto.
* gfortran.dg/inline_sum_bounds_check_1.f90: Ditto.
* gfortran.dg/intent_optimize_1.f90: Ditto.
* gfortran.dg/pointer_init_9.f90: Ditto.
* gfortran.dg/volatile4.f90: Ditto.
* gfortran.dg/volatile6.f90: Ditto.

From-SVN: r208668

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/assumed_rank_7.f90
gcc/testsuite/gfortran.dg/c_ptr_tests_16.f90
gcc/testsuite/gfortran.dg/inline_sum_bounds_check_1.f90
gcc/testsuite/gfortran.dg/intent_optimize_1.f90
gcc/testsuite/gfortran.dg/pointer_init_9.f90 [deleted file]
gcc/testsuite/gfortran.dg/volatile4.f90
gcc/testsuite/gfortran.dg/volatile6.f90

index 78dbc5d38926f172881648f959e2759cdeb0f022..0386d1d936bb17fe5419645f5101a04927b3d646 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-18  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/55207
+       PR fortran/60549
+       * decl.c (match_attr_spec): Revert r208590.
+
 2014-03-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR ipa/58721
index c7f5eed36824eba5673f6013d4b392a40113368d..2d405fe983802fb829bb5b014d01d109beb0de4f 100644 (file)
@@ -3827,11 +3827,9 @@ match_attr_spec (void)
        }
     }
 
-  /* 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)
+  /* 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;
index ffb6112cc59deb8deff5d4bb12ec34780745addf..0de4f716020cf9157546a491553da86b2aebe6d8 100644 (file)
@@ -1,3 +1,15 @@
+2014-03-18  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/55207
+       PR fortran/60549
+       * gfortran.dg/assumed_rank_7.f90: Revert r208590.
+       * gfortran.dg/c_ptr_tests_16.f90: Ditto.
+       * gfortran.dg/inline_sum_bounds_check_1.f90: Ditto.
+       * gfortran.dg/intent_optimize_1.f90: Ditto.
+       * gfortran.dg/pointer_init_9.f90: Ditto.
+       * gfortran.dg/volatile4.f90: Ditto.
+       * gfortran.dg/volatile6.f90: Ditto.
+
 2014-03-18  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/55383
index a5dc8157a4fef2bc8a91b092b4ad175e56ff690b..f9ff3b9aa424531d9cf6a4526fba72e751d38ff1 100644 (file)
@@ -24,8 +24,6 @@ call bar(ac)
 call bar(at)
 if (i /= 12) call abort()
 
-deallocate(ac,at)
-
 contains
   subroutine bar(x)
     type(t) :: x(..)
index 3602428a0ac14adfe863e4ee941992d36ff76f6a..8855d62abaacf3af2addab912e98bf30461671a6 100644 (file)
@@ -3,7 +3,7 @@
 !
 ! PR fortran/46974
 
-subroutine test
+program test
   use ISO_C_BINDING
   implicit none
   type(c_ptr) :: m
@@ -15,7 +15,7 @@ subroutine test
      .and. int(z'41424345') /= a  &
      .and. int(z'4142434500000000',kind=8) /= a) &
     call i_do_not_exist()
-end subroutine
+end program test
 
 ! Examples contributed by Steve Kargl and James Van Buskirk
 
index 579e936624da9cef8550c2260f4c4ea968ab2c4a..39984683d4bf23d94ab69dfb7e0b58fd6c584c07 100644 (file)
@@ -1,9 +1,9 @@
 ! { dg-do run }
-! { dg-options "-fbounds-check -Wno-aggressive-loop-optimizations" }
+! { dg-options "-fbounds-check" }
 
       integer, parameter :: nx = 3, ny = 4
 
-      integer :: i, too_big
+      integer :: i, j, too_big
 
       integer, parameter, dimension(nx,ny) :: p = &
         reshape((/ (i*i, i=1,size(p)) /), shape(p))
index 580db4284f93e9b291d2c851bd111783c75d8db1..dbe0128d7f0d16ee5769283df8ca2f51c8c0c71c 100644 (file)
@@ -6,10 +6,7 @@
 ! honoured.
 !
 ! PR fortran/43665
-
-
-subroutine test
-
+!
 interface
   subroutine foo(x)
     integer, intent(in) :: x
diff --git a/gcc/testsuite/gfortran.dg/pointer_init_9.f90 b/gcc/testsuite/gfortran.dg/pointer_init_9.f90
deleted file mode 100644 (file)
index 1b47135..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-! { dg-do run }
-!
-! PR 55207: [F08] Variables declared in the main program should implicitly get the SAVE attribute
-!
-! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
-
-  type :: c
-  end type c
-
-  type(c), target :: x
-  class(c), pointer :: px => x
-
-  if (.not. associated(px)) call abort()
-end
index 4ad09dcb5d7017740cbbdff3b8c3e1458b01888f..f58a873dfb47accb9c45e5a8a9b25fdf3173fd0c 100644 (file)
@@ -2,8 +2,6 @@
 ! { dg-options "-O2 -fdump-tree-optimized" }
 ! Tests whether volatile really works
 ! PR fortran/29601
-
-subroutine sub
 logical, volatile :: t1
 logical :: t2
 integer :: i
index 439183a1794a96dd6e4db1b73f262b84c65209bc..e42e3de3acbb1ab36b9e7b4178d533991eaadeb8 100644 (file)
@@ -2,8 +2,6 @@
 ! { dg-options "-O2 -fdump-tree-optimized" }
 ! Tests whether volatile really works for arrays
 ! PR fortran/29601
-
-subroutine sub
 logical, allocatable, volatile :: t1(:)
 logical, allocatable :: t2(:)
 integer :: i
This page took 0.088358 seconds and 5 git commands to generate.