2010-04-28 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Apr 2010 20:43:18 +0000 (20:43 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Apr 2010 20:43:18 +0000 (20:43 +0000)
        PR fortran/18918
        PR fortran/43919
        * simplify.c (simplify_cobound): Handle scalar coarrays.

2010-04-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/18918
        PR fortran/43919
        * gfortran.dg/coarray_11.f90: Add scalar-coarrays test case.

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

gcc/fortran/ChangeLog
gcc/fortran/simplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_11.f90

index 19e77e1..5bde472 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/18918
+       PR fortran/43919
+       * simplify.c (simplify_cobound): Handle scalar coarrays.
+
 2010-04-27  Tobias Burnus  <burnus@net-b.de>
 
        * gfc-internals.texi: Update copyright year.
index 1838c00..a40cec1 100644 (file)
@@ -2936,6 +2936,13 @@ simplify_cobound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper)
          switch (ref->u.ar.type)
            {
            case AR_ELEMENT:
+             if (ref->next == NULL)
+               {
+                 gcc_assert (ref->u.ar.as->corank > 0
+                             && ref->u.ar.as->rank == 0);
+                 as = ref->u.ar.as;
+                 goto done;
+               }
              as = NULL;
              continue;
 
index 495a762..f6628f8 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/18918
+       PR fortran/43919
+       * gfortran.dg/coarray_11.f90: Add scalar-coarrays test case.
+
 2010-04-28  Matthias Klose  <doko@ubuntu.com>
 
        * gcc.dg/plugin/plugin.exp: Run the plugindir tests.
index 969d491..7ec7353 100644 (file)
@@ -2,6 +2,7 @@
 ! { dg-options "-fcoarray=single -fdump-tree-original" }
 !
 ! PR fortran/18918
+! PR fortran/43919 for boundsTest()
 !
 ! Coarray intrinsics
 !
@@ -52,5 +53,12 @@ if (lcobound(a,dim=3,kind=8) /= -3_8)  call not_existing()
 if (ucobound(a,dim=1,kind=2) /=  9_2)  call not_existing()
 end subroutine andanother
 
+subroutine boundsTest()
+  implicit none
+  integer :: a[*] = 7
+  if (any (lcobound(a) /= [1])) call not_existing()
+  if (any (ucobound(a) /= [1])) call not_existing()
+end subroutine boundsTest
+
 ! { dg-final { scan-tree-dump-times "not_existing" 0 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }