re PR fortran/59228 (ICE-on-invalid with assumed type and ASYNCHRONOUS)
authorJanus Weil <janus@gcc.gnu.org>
Sat, 23 Nov 2013 09:14:11 +0000 (10:14 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Sat, 23 Nov 2013 09:14:11 +0000 (10:14 +0100)
2013-11-23  Janus Weil  <janus@gcc.gnu.org>

PR fortran/59228
* interface.c (compare_parameter): Check for array spec.

2013-11-23  Janus Weil  <janus@gcc.gnu.org>

PR fortran/59228
* gfortran.dg/asynchronous_4.f90: New.

From-SVN: r205304

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

index 5b66a7b7e46a9c9f0a2bfa781cb6a2c0ae8533a3..61c02100a563726ddd4f229bcbf68bb1a546978d 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-23  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/59228
+       * interface.c (compare_parameter): Check for array spec.
+
 2013-11-22  Andrew MacLeod  <amacleod@redhat.com>
 
        * trans.c: Add required include files from gimple.h.
index 0504c904b96d91f9783d244a21631f037f693aa8..5a0aa2677079830004587900dec9d4c2a8e534fd 100644 (file)
@@ -2092,7 +2092,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
       && (actual->symtree->n.sym->attr.asynchronous
          || actual->symtree->n.sym->attr.volatile_)
       &&  (formal->attr.asynchronous || formal->attr.volatile_)
-      && actual->rank && !gfc_is_simply_contiguous (actual, true)
+      && actual->rank && formal->as && !gfc_is_simply_contiguous (actual, true)
       && ((formal->as->type != AS_ASSUMED_SHAPE
           && formal->as->type != AS_ASSUMED_RANK && !formal->attr.pointer)
          || formal->attr.contiguous))
index 12d2c907b0513d52cbec073e1a5866b1890f9fef..dc8909259e246b5fd36171ac5a634037c386b600 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-23  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/59228
+       * gfortran.dg/asynchronous_4.f90: New.
+
 2013-11-22  Jakub Jelinek  <jakub@redhat.com>
 
        * c-c++-common/asan/no-redundant-instrumentation-7.c: Fix
diff --git a/gcc/testsuite/gfortran.dg/asynchronous_4.f90 b/gcc/testsuite/gfortran.dg/asynchronous_4.f90
new file mode 100644 (file)
index 0000000..ca6cd6c
--- /dev/null
@@ -0,0 +1,22 @@
+! { dg-do compile }
+!
+! PR 59228: ICE with assumed type and ASYNCHRONOUS
+!
+! Contributed by Valery Weber <valeryweber@hotmail.com>
+
+  IMPLICIT NONE
+
+  interface
+     subroutine test(base)
+       TYPE(*), ASYNCHRONOUS :: base
+     end subroutine
+  end interface
+
+CONTAINS
+
+  SUBROUTINE foo ( data )
+    REAL, DIMENSION( : ), ASYNCHRONOUS :: data
+    CALL test ( data )                ! { dg-error "Rank mismatch in argument" }
+  END SUBROUTINE
+
+END