On Jun 17, 2011, at 9:46 AM, Chris Lattner wrote:

> 
> On Jun 17, 2011, at 9:37 AM, Douglas Gregor wrote:
> 
>> I'm deeply suspicious of AggExprEmitter::VisitBinAssign()'s
>> optimization where it emits the RHS of an aggregate assignment
>> directly into the LHS lvalue without checking whether there is any
>> aliasing between the LHS/RHS. However, I'm not in a position to
>> revisit this now.
> 
> FWIW, it is making the assumption that the LHS/RHS either don't alias, or 
> that they *exactly* alias.  The LLVM optimizer (and gcc fwiw) make the 
> assumption that memcpy(X,X, ...) is safe.


It's making the assumption that we can perform piecemeal initialization of the 
LHS from the RHS, rather than building the RHS as a separate aggregate and then 
memcpy'ing it over.

I have a more satisfying fix coming.

        - Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to