This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Structure Return Testcase
- To: gcc at gcc dot gnu dot org
- Subject: Re: Structure Return Testcase
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Date: Thu, 15 Mar 2001 18:46:00 -0600 (CST)
- Cc: rittle at latour dot rsch dot comm dot mot dot com
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
- References: <Pine.LNX.4.32.0103151901200.20427-100000@kern.srcf.societies.cam.ac.uk>
> 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