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
This commit is contained in:
Francois-Xavier Coudert 2007-11-03 22:12:03 +00:00 committed by François-Xavier Coudert
parent 847c8ce4d1
commit 83dffdeb44
4 changed files with 31 additions and 2 deletions

View file

@ -1,3 +1,9 @@
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.

View file

@ -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? */

View file

@ -1,3 +1,8 @@
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

View file

@ -0,0 +1,18 @@
! { 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