Commit 83dffdeb by Francois-Xavier Coudert Committed by François-Xavier Coudert

re PR fortran/33881 (wrong code for assumed length character arrays)

	PR fortran/33881

	* trans-array.c (gfc_conv_array_parameter): Evaluate
	se->string_length instead of the expr->ts.cl->backend_decl.

	* gfortran.dg/assumed_charlen_arg_1.f90: New test.

From-SVN: r129874
parent 847c8ce4
2007-11-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33881
* trans-array.c (gfc_conv_array_parameter): Evaluate
se->string_length instead of the expr->ts.cl->backend_decl.
2007-11-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* gfortran.h: Shorten comment.
* trans-types.c (gfc_get_function_type): Allow argument to have
flavor FL_PROGRAM.
......
......@@ -4972,8 +4972,8 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
if (expr->expr_type == EXPR_ARRAY && expr->ts.type == BT_CHARACTER)
{
get_array_ctor_strlen (&se->pre, expr->value.constructor, &tmp);
expr->ts.cl->backend_decl = gfc_evaluate_now (tmp, &se->pre);
se->string_length = expr->ts.cl->backend_decl;
expr->ts.cl->backend_decl = tmp;
se->string_length = gfc_evaluate_now (tmp, &se->pre);
}
/* Is this the result of the enclosing procedure? */
......
2007-11-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33881
* gfortran.dg/assumed_charlen_arg_1.f90: New test.
2007-11-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/29062
! { dg-do run }
! From PR 33881
call create_watch_ss(" ")
contains
subroutine create_watch_actual(name)
character(len=1) :: name(1)
end subroutine create_watch_actual
subroutine create_watch_ss(name,clock)
character(len=*) :: name
integer, optional :: clock
if (present(clock)) then
call create_watch_actual((/name/))
else
call create_watch_actual((/name/))
end if
end subroutine create_watch_ss
end
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