[cfe-commits] [Patch][Review] Bug 13329 - Incorrect code generated for automatic assignment operator

Douglas Gregor dgregor at apple.com
Mon Jul 16 22:24:37 PDT 2012


On Jul 16, 2012, at 3:43 AM, Jonathan Sauer <jonathan.sauer at gmx.de> wrote:

> Hello,
> 
> attached is a patch (without tests) to fix <http://llvm.org/bugs/show_bug.cgi?id=13329>.
> With this patch, the llvm.memcpy instruction generated by clang only copy the whole struct
> if it is a POD. Otherwise they do no longer copy the tail padding as well, as it can and
> will be reused for the fields of derived classes.
> 
> If the general approach to fixing this bug is ok I will add the necessary tests.


As noted in the PR:

This is definitely the right approach. A few specific comments:

  - This change should affect the the EmitGCMemmoveCollectable call as well,
since the same bug exists there for Objective-C++ GC
  - There are other CreateMemCpy calls in IR generation that likely need this
same computation. Please factor this computation into a separate routine and
update those callers
  - Please include a test case that generates IR and checks that it does the
right thing
Thanks for working on this!

	- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120716/67f472df/attachment.html>


More information about the cfe-commits mailing list