[cfe-commits] r133261 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp test/CodeGen/compound-literal.c

Douglas Gregor dgregor at apple.com
Fri Jun 17 10:11:57 PDT 2011

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

More information about the cfe-commits mailing list