This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Structure Return Testcase
On Thu, Mar 15, 2001 at 04:26:10PM -0700, Jeffrey A Law wrote:
> I'd think you'd want a bit on the expression. Or maybe the other way
> around, a bit when we know there's no overlap (ie, flip the default to be
> the safe way -- memmove and use memcpy only when we can prove its safe).
The reason I liked a different tree code is that in most places
that we use modify_expr, we don't _have_ to prove it's "safe".
It's the user's responsibility to not violate normal assignment
constraints.
Also, I seem to recall that Craig Burley mentioned that there
was some case for which Fortran needed safe handling of overlap.
I don't know what's used in f771 at the moment -- perhaps these
things are just mishandled currently.
If we were to ever optimize this at the tree level, "bit flipping",
if you will, would consist of replacing one tree code with another.
I think that's much clearer than a flag.
> That's what I'm starting to think is the right thing to do. Let's get it
> working correctly, then try to improve/refine our selection of memcpy vs
> memmove.
Well, the immediate refinement is to use COPY_EXPR (for lack of a
better name) in the front end only when generating the copy to the
RESULT_DECL.
r~