OSDN Git Service

2007-02-20 Thomas Koenig <Thomas.Koenig@online.de>
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Feb 2007 21:50:20 +0000 (21:50 +0000)
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Feb 2007 21:50:20 +0000 (21:50 +0000)
PR fortran/30869
* match.c(gfc_match_iterator):  Remove conflict between
loop variable and pointer.

2007-02-20  Thomas Koenig  <Thomas.Koenig@online.de>

PR fortran/30869
* gfortran.dg/do_pointer_1.f90:  New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122176 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/match.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/do_pointer_1.f90 [new file with mode: 0644]

index 13598b7..3597c36 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-20  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/30869
+       * match.c(gfc_match_iterator):  Remove conflict between
+       loop variable and pointer.
+
 2007-02-20  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/30522
index 012f549..9d199e2 100644 (file)
@@ -534,12 +534,6 @@ gfc_match_iterator (gfc_iterator *iter, int init_flag)
       goto cleanup;
     }
 
-  if (var->symtree->n.sym->attr.pointer)
-    {
-      gfc_error ("Loop variable at %C cannot have the POINTER attribute");
-      goto cleanup;
-    }
-
   m = init_flag ? gfc_match_init_expr (&e1) : gfc_match_expr (&e1);
   if (m == MATCH_NO)
     goto syntax;
index c62ef00..d387079 100644 (file)
@@ -1,3 +1,8 @@
+2007-02-20  Thomas Koenig  <Thomas.Koenig@online.de>
+
+       PR fortran/30869
+       * gfortran.dg/do_pointer_1.f90:  New test.
+
 2007-02-20  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.dg/torture/builtin-nonneg-1.c: Add checks for scalb, scalbn
diff --git a/gcc/testsuite/gfortran.dg/do_pointer_1.f90 b/gcc/testsuite/gfortran.dg/do_pointer_1.f90
new file mode 100644 (file)
index 0000000..548177a
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! PR 30869 - pointer loop variables were wrongly rejected.
+program main
+  integer, pointer :: i
+  allocate (i)
+  do i=1,10
+  end do
+  deallocate (i)
+end program main