This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Structure Return Testcase


> Incidentally, there is an outstanding patch from Loren James Rittle
>
>  http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00272.html
>
> to use memmove for this instance.  He keys the use of memmove on
> seeing a RESULT_DECL,

For the record, my patch to fix the test case is effectively a
one-liner.  The code structure is as pre-existed: I did not add any
code to do this keying (I would not have known how to get that right).
In fact, the comment says that we will "use a safe function when
copying..." but the code precedes to use memcpy() instead of
memmove().  I just make the code match the comment with my patch.

> but it seems much cleaner to generate something
> other than a MODIFY_EXPR with the proper semantics.

I can't disagree with that idea.  However, I hope it is clear that the
current situation where a staging buffer is not used (whether we need
a single memcpy or memmove) is preferable to going back to a staging
buffer (where we always needed two memcpy unless the result was
unused).

To remove the regression from 2.95.2, I think my patch should be
applied.

Regards,
Loren


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]