[cfe-commits] [Patch][Review] Bug 13329 - Incorrect code generated for automatic assignment operator
John McCall
rjmccall at apple.com
Mon Jul 16 22:41:00 PDT 2012
On Jul 16, 2012, at 10:24 PM, Douglas Gregor wrote:
> On Jul 16, 2012, at 3:43 AM, Jonathan Sauer <jonathan.sauer at gmx.de> wrote:
>> 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!
I actually fixed this in 153613, as a fix for PR12204. I was then asked
to revert my change because it caused significant compile-time
regressions under a bootstrap build. My previous commit is still
correct, but I haven't had time to revisit it and perform the necessary
performance testing; if Jonathan would like to do so, that would be
great.
John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120716/c7474e8d/attachment.html>
More information about the cfe-commits
mailing list