This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31009] Use memcpy when assigning whole arrays
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2007 16:58:11 -0000
- Subject: [Bug fortran/31009] Use memcpy when assigning whole arrays
- References: <bug-31009-13648@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from dfranke at gcc dot gnu dot org 2007-03-01 16:58 -------
Tobias, I wouldn't expect gfortran to use memcpy if the array is not
continuous, as in your example.
OTOH, my naive assumption is, that given "this = other", "this(:) = other(:)"
or even "this(a:b) = other(c:d)", it should, in general, be possible to handle
with memcopy, or memmove if this==other and a:b, c:d intersect, as long as the
array shapes are compatible.
Since the finer details of fortran still elude me, is it possible at all that
in a statement as "this = other" were both shall be arrays of compatible shape,
either stride may not equal '1'?
> if(stride == 1)
> else
> for(i = lbound; i <= ubound; i++) that[i] = this[i]
for(i = lbound; i <= ubound; i += stride) that[i] = this[i], probably?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31009