aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2010-04-28 22:43:18 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2010-04-28 22:43:18 +0200
commita10da38141660e26efeb4dad932e051c3cd8467c (patch)
tree532b6cf4f242a59342d47ecc5b72053fdea713e7 /gcc
parent91eace2bff89309929a542a9f3f886978a4c04d7 (diff)
downloadgcc-a10da38141660e26efeb4dad932e051c3cd8467c.zip
gcc-a10da38141660e26efeb4dad932e051c3cd8467c.tar.gz
gcc-a10da38141660e26efeb4dad932e051c3cd8467c.tar.bz2
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-28 Tobias Burnus <burnus@net-b.de> 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. From-SVN: r158843
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/simplify.c7
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_11.f908
4 files changed, 27 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 19e77e1..5bde472 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -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.
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 1838c00..a40cec1 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 495a762..f6628f8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gfortran.dg/coarray_11.f90 b/gcc/testsuite/gfortran.dg/coarray_11.f90
index 969d491..7ec7353 100644
--- a/gcc/testsuite/gfortran.dg/coarray_11.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_11.f90
@@ -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" } }