From: pault Date: Thu, 21 Dec 2006 19:56:34 +0000 (+0000) Subject: 2006-12-21 Paul Thomas X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=11c3ed2a34cf130f9ccbbd05ac94d3a7303c497f;p=thirdparty%2Fgcc.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120117 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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" } }