[cfe-commits] r154883 - in /cfe/trunk: lib/CodeGen/CGExprAgg.cpp test/CodeGen/packed-nest-unpacked.c

Chad Rosier mcrosier at apple.com
Mon Apr 16 18:15:16 PDT 2012


On Apr 16, 2012, at 5:51 PM, Eli Friedman wrote:

> On Mon, Apr 16, 2012 at 5:35 PM, Chad Rosier <mcrosier at apple.com> wrote:
>> Author: mcrosier
>> Date: Mon Apr 16 19:35:38 2012
>> New Revision: 154883
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=154883&view=rev
>> Log:
>> Make sure EmitMoveFromReturnSlot is passing the correct alignment to
>> EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment).
>> rdar://11220251
>> 
>> Modified:
>>    cfe/trunk/lib/CodeGen/CGExprAgg.cpp
>>    cfe/trunk/test/CodeGen/packed-nest-unpacked.c
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=154883&r1=154882&r2=154883&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Mon Apr 16 19:35:38 2012
>> @@ -238,7 +238,7 @@
>> 
>>   // Otherwise, do a final copy,
>>   assert(Dest.getAddr() != Src.getAggregateAddr());
>> -  EmitFinalDestCopy(E, Src, /*Ignore*/ true);
>> +  EmitFinalDestCopy(E, Src, /*Ignore*/ true, Dest.getAlignment().getQuantity());
>>  }
> 
> I think this actually needs to be the minimum of the dest alignment
> and the natural alignment of the type.  (Think about the case where
> the dest is over aligned.)

Committed revision 154893.  Thanks, Eli.

 Chad

> -Eli




More information about the cfe-commits mailing list