[Patch, fortran] PR40551 - Wrong code due to missing copy-in/copy-out stried array to assumed-size dummy

Paul Richard Thomas paul.richard.thomas@gmail.com
Mon Jun 29 19:57:00 GMT 2009


Attached is a fix for the above PR.  This bug has been present in
gfc_trans_arrayfunc_assign forever!  The fix is easy; only feed this
function contiguous left hand sides!

The modification to gfc_full_array_ref_p to flag up contiguous
arguments can be adapted with some work to optimise some other
assignments, although these produce correct code right now.  I'll flag
it up as a job to do.

Bootstrapped and regtested on FC9/x86_64 - OK for trunk and 4.4?

Paul

2009-06-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/40551
	* dependency.h : Add second bool* argument to prototype of
	gfc_full_array_ref_p.
	* dependency.c (gfc_full_array_ref_p): If second argument is
	present, return true if last dimension of reference is an
	element or has unity stride.
	* trans-array.c : Add NULL second argument to references to
	gfc_full_array_ref_p.
	* trans-expr.c: The same, except for;
	(gfc_trans_arrayfunc_assign): Return fail if lhs reference
	is not a full array or a contiguous section.

2009-06-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/40551
	* gfortran.dg/func_assign_2.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-patch
Size: 5214 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090629/062e71a6/attachment.bin>


More information about the Fortran mailing list