+2020-03-27 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93957
+ * trans-array.c (gfc_alloc_allocatable_for_assignment): Accept
+ nonallocatable, nonpointer deferred-rank arrays.
+
2020-03-27 Tobias Burnus <tobias@codesourcery.com>
PR fortran/93363
/* NULLIFY an allocatable/pointer array on function entry, free it on exit.
Do likewise, recursively if necessary, with the allocatable components of
- derived types. */
+ derived types. This function is also called for assumed-rank arrays, which
+ are always dummy arguments. */
void
gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
/* Make sure the frontend gets these right. */
gcc_assert (sym->attr.pointer || sym->attr.allocatable || sym_has_alloc_comp
- || has_finalizer);
+ || has_finalizer
+ || (sym->as->type == AS_ASSUMED_RANK && sym->attr.dummy));
gfc_save_backend_locus (&loc);
gfc_set_backend_locus (&sym->declared_at);
+2020-03-27 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93957
+ * gfortran.dg/assumed_rank_19.f90: New.
+
2020-03-27 Tobias Burnus <tobias@codesourcery.com>
PR fortran/93363
--- /dev/null
+! { dg-do run }
+!
+! PR fortran/93957
+!
+! Contributed by José Rui Faustino de Sousa
+
+function f_ice(this) result(that) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int
+
+ implicit none
+
+ integer(kind=c_int), intent(in) :: this(..)
+ integer(kind=c_int) :: that
+
+ that = size(this)
+ return
+end function f_ice
+
+program ice_p
+ use, intrinsic :: iso_c_binding, only: c_int
+ implicit none
+
+ interface
+ function f_ice(this) result(that) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int
+ integer(kind=c_int), intent(in) :: this(..)
+ integer(kind=c_int) :: that
+ end function f_ice
+ end interface
+
+ integer(kind=c_int), parameter :: n = 10
+
+ integer(kind=c_int) :: intp(n)
+
+ if(size(intp)/=n) stop 1
+ if(f_ice(intp)/=n) stop 2
+end program ice_p