From: Paul Thomas Date: Thu, 21 Dec 2006 19:56:34 +0000 (+0000) Subject: re PR fortran/30273 ([4.1 only] gfc_todo: Not Implemented: Unable to determine rank... X-Git-Tag: releases/gcc-4.3.0~7871 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=681150cdaa87e47d1cc8b57d6a29d73b3170343a;p=thirdparty%2Fgcc.git re PR fortran/30273 ([4.1 only] gfc_todo: Not Implemented: Unable to determine rank of expression) 2006-12-21 Paul Thomas PR fortran/30273 * dependency.c (gfc_check_dependency): There is no dependency with EXPR_NULL so always return 0. 2006-12-21 Paul Thomas PR fortran/30273 * gfortran.dg/dependency_19.f90: New test. From-SVN: r120117 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c0dd40a16e38..5d12d75966ca 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2006-12-21 Paul Thomas + + PR fortran/30273 + * dependency.c (gfc_check_dependency): There is no dependency + with EXPR_NULL so always return 0. + 2006-12-21 Paul Thomas PR fortran/30202 diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index f9ba4459ffaf..53bf9e181b7a 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -694,6 +694,7 @@ gfc_check_dependency (gfc_expr * expr1, gfc_expr * expr2, bool identical) return 0; case EXPR_CONSTANT: + case EXPR_NULL: return 0; case EXPR_ARRAY: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fb6666e68d09..3a094a5ec9be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-12-21 Paul Thomas + + PR fortran/30273 + * gfortran.dg/dependency_19.f90: New test. + 2006-12-21 Paul Thomas PR fortran/30202 diff --git a/gcc/testsuite/gfortran.dg/dependency_19.f90 b/gcc/testsuite/gfortran.dg/dependency_19.f90 new file mode 100644 index 000000000000..b0af158553e2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/dependency_19.f90 @@ -0,0 +1,34 @@ +! { dg-do compile } +! Tests the fix for PR30273, in which the pointer assignment was +! wrongly determined to have dependence because NULL() was not +! recognised by the analysis. +! +! Contributed by Harald Anlauf +! +module gfcbug49 + implicit none + + type spot_t + integer, pointer :: vm(:,:,:) + end type spot_t + + type rc_t + integer :: n + type(spot_t), pointer :: spots(:) => NULL() + end type rc_t + +contains + + subroutine construct (rc, n) + type(rc_t), intent(out) :: rc + integer , intent(in) :: n + integer :: k + rc% n = n + allocate (rc% spots (n)) + forall (k=1:n) + rc% spots (k)% vm => NULL() ! gfortran didn't swallow this + end forall + end subroutine construct + +end module gfcbug49 +! { dg-final { cleanup-modules "gfcbug49" } }