]> granicus.if.org Git - clang/commit
When emitting a compound literal of POD type, continue to emit a
authorDouglas Gregor <dgregor@apple.com>
Fri, 17 Jun 2011 16:37:20 +0000 (16:37 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 17 Jun 2011 16:37:20 +0000 (16:37 +0000)
commit673e98b4814642eb040a661fcc0f7953edd4c150
treea832de8b26bf9a08ffee5dfb4e977ac96546cde6
parentc99f0ec89fd9782cfafd14d7b1b0a80151eab24a
When emitting a compound literal of POD type, continue to emit a
separate aggregate temporary and then memcpy it over to the
destination. This fixes a regression I introduced with r133235, where
the compound literal on the RHS of an assignment makes use of the
structure on the LHS of the assignment.

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.

Big thanks to Eli for finding the regression!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133261 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprAgg.cpp
test/CodeGen/compound-literal.c