+2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
+
+ * trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable'
+ attribute from sym to new_sym. Call build_fold_indirect_ref()
+ for allocatable arguments.
+
2006-03-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26257
new_sym->attr.referenced = 1;
new_sym->attr.dimension = sym->attr.dimension;
new_sym->attr.pointer = sym->attr.pointer;
+ new_sym->attr.allocatable = sym->attr.allocatable;
new_sym->attr.flavor = sym->attr.flavor;
/* Create a fake symtree for it. */
value = build_fold_indirect_ref (value);
}
- /* If the argument is a scalar or a pointer to an array, dereference it. */
- else if (!sym->attr.dimension || sym->attr.pointer)
+ /* If the argument is a scalar, a pointer to an array or an allocatable,
+ dereference it. */
+ else if (!sym->attr.dimension || sym->attr.pointer || sym->attr.allocatable)
value = build_fold_indirect_ref (se->expr);
/* For character(*), use the actual argument's descriptor. */
+2006-03-09 Erik Edelmann <eedelman@gcc.gnu.org>
+
+ * gfortran.dg/allocatable_dummy_1.f90: Test for functions returning
+ arrays too.
+
2006-03-09 Diego Novillo <dnovillo@redhat.com>
* gcc/testsuite/g++.dg/gomp: New directory.
call useit(a, b)
if (.NOT.all(b == [ 1, 2, 3 ])) call abort()
+ if (.NOT.all(whatever(a) == [ 1, 2, 3 ])) call abort()
+
call kill(a)
if (allocated(a)) call abort()
y = x
end subroutine useit
+ function whatever(x)
+ integer, allocatable :: x(:)
+ integer :: whatever(size(x))
+
+ whatever = x
+ end function whatever
+
subroutine kill(x)
integer, allocatable, intent(out) :: x(:)
end subroutine kill