2013-11-23 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 23 Nov 2013 09:14:11 +0000 (09:14 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 23 Nov 2013 09:14:11 +0000 (09:14 +0000)
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.

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

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

index 5b66a7b..61c0210 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 0504c90..5a0aa26 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 12d2c90..dc89092 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