From: Tobias Burnus Date: Wed, 28 Apr 2010 20:43:18 +0000 (+0200) Subject: re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays]) X-Git-Tag: releases/gcc-4.6.0~7590 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a10da38141660e26efeb4dad932e051c3cd8467c;p=thirdparty%2Fgcc.git re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays]) 2010-04-28 Tobias Burnus PR fortran/18918 PR fortran/43919 * simplify.c (simplify_cobound): Handle scalar coarrays. 2010-04-28 Tobias Burnus PR fortran/18918 PR fortran/43919 * gfortran.dg/coarray_11.f90: Add scalar-coarrays test case. From-SVN: r158843 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 19e77e1e20f1..5bde472edf4a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2010-04-28 Tobias Burnus + + PR fortran/18918 + PR fortran/43919 + * simplify.c (simplify_cobound): Handle scalar coarrays. + 2010-04-27 Tobias Burnus * gfc-internals.texi: Update copyright year. diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 1838c0071eac..a40cec103d9e 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 495a7623160a..f6628f87f31d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-04-28 Tobias Burnus + + PR fortran/18918 + PR fortran/43919 + * gfortran.dg/coarray_11.f90: Add scalar-coarrays test case. + 2010-04-28 Matthias Klose * 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 969d4911caa0..7ec735357328 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" } }