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: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2007 10:43:20 -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 #5 from burnus at gcc dot gnu dot org 2007-03-02 10:43 -------
> Tobias, do the cases given in PR31016 include the one above?
> If yes, this PR could be closed as dupe?!
Actually not. PR 31016 (and related PR 31014) are about cases where one
actually knows that the memory is contiguous (with the size known either at
compile time or only at run time). There using memcpy or memset should always
be a win (except, maybe, for a one-element array).
This PR is about cases were the memory might not be contiguous; thus one needs
create code for both the contiguous and non-contiguous case and a check whether
either case is present. I believe this needs some thinking (and testing) to
make sure that the size of the generated code does not increase too much (at
least not for -Os) and that it is an overall gain without loosing to much speed
for real-world code with on non-contiguous arrays (strides).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31009