re PR fortran/44353 (rejects legal fortran)
authorPaul Thomas <pault@gcc.gnu.org>
Sun, 18 Jul 2010 16:15:43 +0000 (16:15 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sun, 18 Jul 2010 16:15:43 +0000 (16:15 +0000)
2010-07-18  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/44353
* match.c (gfc_match_iterator): Remove error that iterator
cannot be INTENT(IN).

2010-07-18  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/44353
* gfortran.dg/data_implied_do_2.f03 : New test.

From-SVN: r162286

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

index 81722a1b7b51c337d842795ed1fe6b670ff8e884..48144b05806274cb97f4992e357962f5bcdcfab2 100644 (file)
@@ -1,3 +1,9 @@
+2010-07-18  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/44353
+       * match.c (gfc_match_iterator): Remove error that iterator
+       cannot be INTENT(IN).
+
 2010-07-17  Mikael Morin  <mikael@gcc.gnu.org>
 
        * trans-array.c (gfc_free_ss): Don't free beyond ss rank.
index 56e9d1d515dd9085be3d98d5579a0ddc1e40623f..3761261fff0537378c1452ed095f3f2d9545065d 100644 (file)
@@ -978,13 +978,6 @@ gfc_match_iterator (gfc_iterator *iter, int init_flag)
       goto cleanup;
     }
 
-  if (var->symtree->n.sym->attr.intent == INTENT_IN)
-    {
-      gfc_error ("Loop variable '%s' at %C cannot be INTENT(IN)",
-                var->symtree->n.sym->name);
-      goto cleanup;
-    }
-
   gfc_match_char ('=');
 
   var->symtree->n.sym->attr.implied_index = 1;
index aaaed845a52e29d0d5b878cc128cad66ed8a2931..7cf7beba5afd8c46f70b662134cc431cdceaf500 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-18  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/44353
+       * gfortran.dg/data_implied_do_2.f03 : New test.
+
 2010-07-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.target/mips/cache-1.c: Allow 0 instead of 0x0.
diff --git a/gcc/testsuite/gfortran.dg/data_implied_do_2.f90 b/gcc/testsuite/gfortran.dg/data_implied_do_2.f90
new file mode 100644 (file)
index 0000000..e07690d
--- /dev/null
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! Tests the fix for PR44353
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+!
+      subroutine sub(i)
+      intent(in) i
+      integer ii(10)
+      data (ii(i),i=1,10) /10*0/ ! failed here
+      end