[PATCH,committed] Fix gfortran regression.
Steve Kargl
sgk@troutmask.apl.washington.edu
Sat Jul 15 05:49:00 GMT 2006
I committed the below patch to fix a recent regression in
gfortran. The problem appears to be related to pointer
arithmetic where 64-bit pointers expose the bug. I've
bootstrapped and regression tested the patch on i386-*-freebsd
and amd64-*-freebsd. i386-* does not exhibit the bug.
amd64-* does. I've had confirmation that the patch does not
break i686-pc-linux-*.
2006-07-14 Steven G. Kargl <kargls@comcast.net>
* trans-expr.c (gfc_trans_string_copy): Evaluate the string lengths
Index: trans-expr.c
===================================================================
--- trans-expr.c (revision 115447)
+++ trans-expr.c (working copy)
@@ -2228,10 +2228,10 @@ gfc_conv_function_call (gfc_se * se, gfc
/* 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;
@@ -2240,6 +2240,9 @@ gfc_trans_string_copy (stmtblock_t * blo
tree tmp3;
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);
--
Steve
More information about the Gcc-patches
mailing list