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]
Other format: [Raw text]

Re: PR c++/39480 not really fixed


From: Richard Guenther <richard.guenther@gmail.com>
Date: Fri, 28 Oct 2011 11:27:25 +0200

> On Fri, Oct 28, 2011 at 9:48 AM, David Miller <davem@davemloft.net> wrote:
>>
>> g++.dg/init/copy7.C makes sure that memcpy() is not emitted with
>> src and dst equal.
> 
> The testcase is bogus and should be removed.  See the patch I posted
> (and the PR).  Unfortunately the patch didn't get any review yet.

Thanks.  Which patch and PR are you talking about, 39480?

Meanwhile, if the conclusion is that memcpy(x, x, ...) is legal, I
disagree.  I can think of implementations where this will break.

For example, if the memcpy implementation does a cache initializing
store on the first cache line of the destination before fetching the
beginning of the source, such memcpy() calls with src==dst will
produce garbage.


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