From ed78a1162c2658c6cbe9f3d1948ee41244fd425c Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Thu, 16 Feb 2006 07:04:13 +0000 Subject: re PR fortran/24557 (ICE: PRINTing function result of size depending on assumed length CHARACTER dummy) 2005-02-16 Paul Thomas PR fortran/24557 * trans-expr.c (gfc_add_interface_mapping): Use the actual argument for character(*) arrays, rather than casting to the type and kind parameters of the formal argument. 2005-02-16 Paul Thomas PR fortran/24557 * gfortran.dg/assumed_charlen_needed_1.f90: New test. From-SVN: r111130 --- gcc/fortran/trans-expr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/fortran/trans-expr.c') diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 3fbbf0e..9f5774b 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1346,6 +1346,10 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping, /* If the argument is a scalar or a pointer to an array, dereference it. */ else if (!sym->attr.dimension || sym->attr.pointer) value = build_fold_indirect_ref (se->expr); + + /* For character(*), use the actual argument's descriptor. */ + else if (sym->ts.type == BT_CHARACTER && !new_sym->ts.cl->length) + value = build_fold_indirect_ref (se->expr); /* If the argument is an array descriptor, use it to determine information about the actual argument's shape. */ -- cgit v1.1