]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/30273 ([4.1 only] gfc_todo: Not Implemented: Unable to determine rank...
authorPaul Thomas <pault@gcc.gnu.org>
Thu, 21 Dec 2006 19:56:34 +0000 (19:56 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Thu, 21 Dec 2006 19:56:34 +0000 (19:56 +0000)
2006-12-21  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/30273
* dependency.c (gfc_check_dependency): There is no dependency
with EXPR_NULL so always return 0.

2006-12-21  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/30273
* gfortran.dg/dependency_19.f90: New test.

From-SVN: r120117

gcc/fortran/ChangeLog
gcc/fortran/dependency.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/dependency_19.f90 [new file with mode: 0644]

index c0dd40a16e388b13b96d196c63bda2e22acbe14c..5d12d75966ca4a0192a7042637e7d74e3617758e 100644 (file)
@@ -1,3 +1,9 @@
+2006-12-21  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/30273
+       * dependency.c (gfc_check_dependency): There is no dependency
+       with EXPR_NULL so always return 0.
+
 2006-12-21  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/30202
index f9ba4459ffaf3a7258b41d6fff94241cbffddea1..53bf9e181b7a9d83abbdcf2b7d5f64e762ea0c42 100644 (file)
@@ -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:
index fb6666e68d098b0ce7ba6264ce1b6878f9f8712a..3a094a5ec9be5c0c2c63e944f684e63478d6174d 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-21  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/30273
+       * gfortran.dg/dependency_19.f90: New test.
+
 2006-12-21  Paul Thomas  <pault@gcc.gnu.org>
 
        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 (file)
index 0000000..b0af158
--- /dev/null
@@ -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 <anlauf@gmx.de>
+!
+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" } }