OSDN Git Service

2007-03-03 Paul Thomas <pault@gcc.gnu.org>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Mar 2007 10:43:25 +0000 (10:43 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 3 Mar 2007 10:43:25 +0000 (10:43 +0000)
        PR fortran/30882
* check.c (dim_rank_check): The shape of subsections of
assumed-size arrays is known.

2007-03-03  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/30882
* gfortran.dg/size_dim.f90: New test.

--         Diese und die folgenden Zeilen werden ignoriert --

M    gcc/testsuite/ChangeLog
A    gcc/testsuite/gfortran.dg/size_dim.f90
M    gcc/fortran/ChangeLog
M    gcc/fortran/check.c

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122503 138bc75d-0d04-0410-961f-82ee72b054a4

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

index afd9d26..58b96b6 100644 (file)
@@ -1,3 +1,9 @@
+2007-03-03  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/30882
+       * check.c (dim_rank_check): The shape of subsections of
+       assumed-size arrays is known.
+
 2007-03-02  Paul Thomas  <pault@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>
 
index 6e4d798..27becfc 100644 (file)
@@ -337,7 +337,10 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
 
   ar = gfc_find_array_ref (array);
   rank = array->rank;
-  if (ar->as->type == AS_ASSUMED_SIZE && !allow_assumed)
+  if (ar->as->type == AS_ASSUMED_SIZE
+      && !allow_assumed
+      && ar->type != AR_ELEMENT
+      && ar->type != AR_SECTION)
     rank--;
 
   if (mpz_cmp_ui (dim->value.integer, 1) < 0
index e87707c..e2d41a9 100644 (file)
@@ -1,3 +1,9 @@
+2007-03-03  Paul Thomas  <pault@gcc.gnu.org>
+           Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/30882
+       * gfortran.dg/size_dim.f90: New test.
+
 2007-03-02  Paul Thomas  <pault@gcc.gnu.org>
            Tobias Burnus  <burnus@net-b.de>
 
diff --git a/gcc/testsuite/gfortran.dg/size_dim.f90 b/gcc/testsuite/gfortran.dg/size_dim.f90
new file mode 100644 (file)
index 0000000..248a0c3
--- /dev/null
@@ -0,0 +1,15 @@
+! { dg-do "run" }
+! Check size with initialization expression value for dim=
+! PR fortran/30882
+!
+! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
+!
+program main
+  integer :: a(10)
+  call S1(a)
+contains
+  subroutine S1(a)
+    integer :: a(*)
+    if(size(a(1:10),1) /= 10) call abort()
+  end subroutine S1
+end program main