trans-intrinsic.c (gfc_conv_intrinsic_repeat): Convert arguments to gfc_charlen_type_node.

2007-07-12  Richard Guenther  <rguenther@suse.de>

	* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Convert
	arguments to gfc_charlen_type_node.
	* trans-io.c (gfc_convert_array_to_string): Convert type
	size to gfc_array_index_type.

From-SVN: r126575
This commit is contained in:
Richard Guenther 2007-07-12 09:30:27 +00:00 committed by Richard Biener
parent 176be57bea
commit 553b66ad1d
3 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2007-07-12 Richard Guenther <rguenther@suse.de>
* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Convert
arguments to gfc_charlen_type_node.
* trans-io.c (gfc_convert_array_to_string): Convert type
size to gfc_array_index_type.
2007-07-12 Daniel Franke <franke.daniel@gmail.com>
PR fortran/32634

View File

@ -3570,7 +3570,9 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
&se->pre, &expr->where);
/* Compute the destination length. */
dlen = fold_build2 (MULT_EXPR, gfc_charlen_type_node, slen, ncopies);
dlen = fold_build2 (MULT_EXPR, gfc_charlen_type_node,
fold_convert (gfc_charlen_type_node, slen),
fold_convert (gfc_charlen_type_node, ncopies));
type = gfc_get_character_type (expr->ts.kind, expr->ts.cl);
dest = gfc_conv_string_tmp (se, build_pointer_type (type), dlen);
@ -3594,7 +3596,8 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
gfc_add_expr_to_block (&body, tmp);
/* Call memmove (dest + (i*slen), src, slen). */
tmp = fold_build2 (MULT_EXPR, gfc_charlen_type_node, slen,
tmp = fold_build2 (MULT_EXPR, gfc_charlen_type_node,
fold_convert (gfc_charlen_type_node, slen),
fold_convert (gfc_charlen_type_node, count));
tmp = fold_build2 (POINTER_PLUS_EXPR, pchar_type_node,
fold_convert (pchar_type_node, dest),

View File

@ -623,7 +623,8 @@ gfc_convert_array_to_string (gfc_se * se, gfc_expr * e)
}
tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type));
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp);
size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
fold_convert (gfc_array_index_type, tmp));
se->string_length = fold_convert (gfc_charlen_type_node, size);
}