This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, fortran] PR25951 - Regression with LOC and assumed size arrays


I am sorry to report that another one of these regressions has creapt out of the woodwork. Again the fix is a one-liner.

Regtests on FC3. OK to commit tomorrow morning on trunk and 4.1?

Paul

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

   PR fortran/25964
   * resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
   generic_id's exempted from assumed size checking.

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

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

Index: gcc/fortran/resolve.c
===================================================================
*** gcc/fortran/resolve.c       (revision 110269)
--- gcc/fortran/resolve.c       (working copy)
*************** resolve_function (gfc_expr * expr)
*** 1304,1309 ****
--- 1304,1310 ----
   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


! { 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]