re PR fortran/44457 (Missing ASYNCHRONOUS constraint check)
authorDaniel Franke <franke.daniel@gmail.com>
Thu, 10 Jun 2010 18:25:56 +0000 (14:25 -0400)
committerDaniel Franke <dfranke@gcc.gnu.org>
Thu, 10 Jun 2010 18:25:56 +0000 (14:25 -0400)
gcc/fortran/:
2010-06-10  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/44457
* interface.c (compare_actual_formal): Reject actual arguments with
array subscript passed to ASYNCHRONOUS dummys.

gcc/testsuite/:
2010-06-10  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/44457
* gfortran.dg/asynchronous_3.f03

From-SVN: r160567

gcc/fortran/ChangeLog
gcc/fortran/interface.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/asynchronous_3.f03 [new file with mode: 0644]

index d463f15139192b570dc01236de01de58cd4e1dad..acb5fe1e65d6a53373c325aa11f01b1b76133189 100644 (file)
@@ -1,3 +1,9 @@
+2010-06-10  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/44457
+       * interface.c (compare_actual_formal): Reject actual arguments with
+       array subscript passed to ASYNCHRONOUS dummys.
+
 2010-06-10  Daniel Kraft  <d@domob.eu>
 
        PR fortran/38936
index 379c636d695958fd0930fb7c2147b5efd79ff065..284622f05e062365dfc73cbaadb728b8dde314fc 100644 (file)
@@ -2133,13 +2133,15 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
 
       if ((f->sym->attr.intent == INTENT_OUT
           || f->sym->attr.intent == INTENT_INOUT
-          || f->sym->attr.volatile_)
+          || f->sym->attr.volatile_
+          || f->sym->attr.asynchronous)
          && gfc_has_vector_subscript (a->expr))
        {
          if (where)
-           gfc_error ("Array-section actual argument with vector subscripts "
-                      "at %L is incompatible with INTENT(OUT), INTENT(INOUT) "
-                      "or VOLATILE attribute of the dummy argument '%s'",
+           gfc_error ("Array-section actual argument with vector "
+                      "subscripts at %L is incompatible with INTENT(OUT), "
+                      "INTENT(INOUT), VOLATILE or ASYNCHRONOUS attribute "
+                      "of the dummy argument '%s'",
                       &a->expr->where, f->sym->name);
          return 0;
        }
index 1a0c99c9b93b133244d28ce42197ff26b999d68d..f5ca670d60bfb69e5de4f5dc71dbc9b1a2aa8dcf 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-10  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/44457
+       * gfortran.dg/asynchronous_3.f03
+
 2010-06-10  Changpeng Fang  <changpeng.fang@amd.com>
 
        PR middle-end/44185
diff --git a/gcc/testsuite/gfortran.dg/asynchronous_3.f03 b/gcc/testsuite/gfortran.dg/asynchronous_3.f03
new file mode 100644 (file)
index 0000000..7b83374
--- /dev/null
@@ -0,0 +1,15 @@
+! { dg-do "compile" }
+!
+! PR fortran/44457 - no array-subscript actual argument
+!                    for an asynchronous dummy
+!
+
+  integer :: a(10), sect(3)
+  sect = [1,2,3]
+  call f(a(sect))    ! { dg-error "incompatible" }
+  call f(a(::2))
+contains
+  subroutine f(x)
+    integer, asynchronous :: x(:)
+  end subroutine f
+end