[Patch, fortran] PR34955 - transfer_assumed_size_1.f90: Valgrind error: invalid read of size 3

Paul Richard Thomas paul.richard.thomas@gmail.com
Tue Jan 13 06:19:00 GMT 2009


Dear All,

The title of this problem describes the problem clearly.  It comes
about only for scalar character transfers where the source is shorter
than the destination.  As described in the PR, the solution is to make
a temporary, with the length of the destination and only copy the
source into it.  All this was effected by use of the mechanics evolved
for array transfers, where the different situations of source versus
destination lengths and the presence of SIZE were correctly (I hope!)
treated.  The use of packing of the source has been eliminated, except
for variables that are not full arrays.

Bootstrapped and regtested on FC9/x86_i64 - OK for 4.5 and, eventually, for 4.4?

Paul

2009-01-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34955
	* trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Has
	been absorbed into gfc_conv_intrinsic_transfer. All
	references to it in trans-intrinsic.c have been changed
	accordingly.  PR fixed by using a temporary for scalar
	character transfer, when the source is shorter than the
	destination.

2009-01-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34955
	* gfortran.dg/transfer_intrinsic_1.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: application/octet-stream
Size: 10706 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090113/44abb0ee/attachment.obj>


More information about the Gcc-patches mailing list