This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33759] Unequal character lengths in MERGE intrinsic not detected at run time
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Oct 2007 16:08:28 -0000
- Subject: [Bug fortran/33759] Unequal character lengths in MERGE intrinsic not detected at run time
- References: <bug-33759-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pault at gcc dot gnu dot org 2007-10-23 16:08 -------
(In reply to comment #3)
> (In reply to comment #2)
> I'll figure out how to fix it.
This does the job:
Index: gcc/fortran/trans-intrinsic.c
===================================================================
*** gcc/fortran/trans-intrinsic.c (revision 129504)
--- gcc/fortran/trans-intrinsic.c (working copy)
*************** gfc_conv_intrinsic_array_transfer (gfc_s
*** 3171,3178 ****
{
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
tmp, dest_word_len);
- tmp = fold_build2 (MIN_EXPR, gfc_array_index_type,
- tmp, source_bytes);
}
else
tmp = source_bytes;
--- 3171,3176 ----
*************** gfc_conv_intrinsic_array_transfer (gfc_s
*** 3229,3235 ****
3,
tmp,
fold_convert (pvoid_type_node, source),
! size_bytes);
gfc_add_expr_to_block (&se->pre, tmp);
se->expr = info->descriptor;
--- 3227,3233 ----
3,
tmp,
fold_convert (pvoid_type_node, source),
! source_bytes);
gfc_add_expr_to_block (&se->pre, tmp);
se->expr = info->descriptor;
and survives "dg.exp=gfortran/transfer*". It is going to be a while before I
can deal with this, so please feel free. (I cannot svn commit from where I
am.)
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33759