Commit eb829078 by Richard Guenther Committed by Richard Biener

trans-expr.c (gfc_trans_string_copy): Use the correct types to compute slen and dlen.

2008-08-31  Richard Guenther  <rguenther@suse.de>

	* trans-expr.c (gfc_trans_string_copy): Use the correct types
	to compute slen and dlen.

From-SVN: r139832
parent 2b2587f5
2008-08-31 Richard Guenther <rguenther@suse.de>
* trans-expr.c (gfc_trans_string_copy): Use the correct types
to compute slen and dlen.
2008-08-31 Daniel Kraft <d@domob.eu>
* gfortran.h (enum gfc_statement): New entry `ST_GENERIC'.
......
......@@ -3066,10 +3066,12 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
/* For non-default character kinds, we have to multiply the string
length by the base type size. */
chartype = gfc_get_char_type (dkind);
slen = fold_build2 (MULT_EXPR, size_type_node, slen,
TYPE_SIZE_UNIT (chartype));
dlen = fold_build2 (MULT_EXPR, size_type_node, dlen,
TYPE_SIZE_UNIT (chartype));
slen = fold_build2 (MULT_EXPR, size_type_node,
fold_convert (size_type_node, slen),
fold_convert (size_type_node, TYPE_SIZE_UNIT (chartype)));
dlen = fold_build2 (MULT_EXPR, size_type_node,
fold_convert (size_type_node, dlen),
fold_convert (size_type_node, TYPE_SIZE_UNIT (chartype)));
if (dlength)
dest = fold_convert (pvoid_type_node, dest);
......
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