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 <pault@gcc.gnu.org>
PR fortran/24557
* gfortran.dg/assumed_charlen_needed_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111130
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-02-16 Paul Thomas <pault@gcc.gnu.org>
+
+ 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.
+
2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/26054
2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/26054
/* 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);
/* 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. */
/* If the argument is an array descriptor, use it to determine
information about the actual argument's shape. */
+2005-02-16 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/24557
+ * gfortran.dg/assumed_charlen_needed_1.f90: New test.
+
2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/26054
2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/26054
--- /dev/null
+! { dg-do compile }
+! Tests the fix for PR24557 in which the return of a
+! temporary character(*) array would cause an ICE.
+!
+! Test case provided by Erik Edelmann <eedelmann@gcc.gnu.org>
+!
+ character(4) :: a(2)
+ print *, fun (a)
+contains
+ function fun (arg)
+ character (*) :: arg (10)
+ integer :: fun(size(arg))
+ fun = 1
+ end function fun
+end