2005-01-27 Paul Thomas <pault@gcc.gnu.org>
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2006 21:20:12 +0000 (21:20 +0000)
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2006 21:20:12 +0000 (21:20 +0000)
PR fortran/25964
* resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
generic_ids exempted from assumed size checking.

2005-01-27  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/25964
* gfortran.dg/assumed_size_refs_3.f90: New test.

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

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/assumed_size_refs_3.f90 [new file with mode: 0755]

index 37f100d..2100d5c 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-27  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/25964
+       * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
+       generic_ids exempted from assumed size checking.
+
 2006-01-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/25324
index 99fb2a2..ca89f88 100644 (file)
@@ -1304,6 +1304,7 @@ resolve_function (gfc_expr * expr)
   else if (expr->value.function.actual != NULL
             && expr->value.function.isym != NULL
             && expr->value.function.isym->generic_id != GFC_ISYM_LBOUND
+            && expr->value.function.isym->generic_id != GFC_ISYM_LOC
             && expr->value.function.isym->generic_id != GFC_ISYM_PRESENT)
     {
       /* Array instrinsics must also have the last upper bound of an
index 04f8764..ff4f007 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-27  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/25964
+       * gfortran.dg/assumed_size_refs_3.f90: New test.
+
 2006-01-27  Ben Elliston  <bje@au.ibm.com>
 
        * gcc.misc-tests/dectest.exp: Remove defunct comment.
diff --git a/gcc/testsuite/gfortran.dg/assumed_size_refs_3.f90 b/gcc/testsuite/gfortran.dg/assumed_size_refs_3.f90
new file mode 100755 (executable)
index 0000000..b8aa44b
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! Tests the fix for PR25951, a regression caused by the assumed
+! size patch.
+! Test case provided by Mark Hesselink  <mhesseli@caltech.edu>
+PROGRAM loc_1
+  integer i(10)
+  call f (i)
+CONTAINS
+   SUBROUTINE f (x)
+      INTEGER, DIMENSION(*)   :: x
+      INTEGER                 :: address
+! The next line would cause:
+! Error: The upper bound in the last dimension must appear in the
+! reference to the assumed size array 'x' at (1)
+      address=LOC(x)
+   END SUBROUTINE f
+END PROGRAM loc_1
\ No newline at end of file