Commit 17029ac2 by Erik Edelmann

trans-expr.c (gfc_add_interface_mapping): Copy 'allocatable' attribute from sym to new_sym.

fortran/
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.

testsuite/
2006-03-09  Erik Edelmann  <eedelman@gcc.gnu.org>

        * gfortran.dg/allocatable_dummy_1.f90: Test for functions returning
        arrays too.

From-SVN: r111910
parent a8c1d5f8
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
......
......@@ -1316,6 +1316,7 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
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. */
......@@ -1367,8 +1368,9 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
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.
......@@ -13,6 +13,8 @@ program alloc_dummy
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()
......@@ -35,6 +37,13 @@ contains
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment