diff options
author | Steven G. Kargl <kargls@comcast.net> | 2006-07-15 05:11:38 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2006-07-15 05:11:38 +0000 |
commit | 5cd8e1235ab323384494098385ec75071b64152b (patch) | |
tree | 3db33dae36595a55d06ad18398dc9d08e584b1f3 /gcc | |
parent | 1321e7aec68278b64df07d35bcf043bd70caf189 (diff) | |
download | gcc-5cd8e1235ab323384494098385ec75071b64152b.zip gcc-5cd8e1235ab323384494098385ec75071b64152b.tar.gz gcc-5cd8e1235ab323384494098385ec75071b64152b.tar.bz2 |
trans-expr.c (gfc_trans_string_copy): Evaluate the string lengths
2006-07-14 Steven G. Kargl <kargls@comcast.net>
* trans-expr.c (gfc_trans_string_copy): Evaluate the string lengths
From-SVN: r115463
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c9a95ce..d21a2bf 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2006-07-14 Steven G. Kargl <kargls@comcast.net> + + * trans-expr.c (gfc_trans_string_copy): Evaluate the string lengths + 006-07-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/28174 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index de003ec..d536dcd 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -2228,10 +2228,10 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, /* Generate code to copy a string. */ static void -gfc_trans_string_copy (stmtblock_t * block, tree dlen, tree dest, - tree slen, tree src) +gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest, + tree slength, tree src) { - tree tmp; + tree tmp, dlen, slen; tree dsc; tree ssc; tree cond; @@ -2241,6 +2241,9 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlen, tree dest, tree tmp4; stmtblock_t tempblock; + dlen = fold_convert (size_type_node, gfc_evaluate_now (dlength, block)); + slen = fold_convert (size_type_node, gfc_evaluate_now (slength, block)); + /* Deal with single character specially. */ dsc = gfc_to_single_character (dlen, dest); ssc = gfc_to_single_character (slen, src); |