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

Eli Friedman eli.friedman at gmail.com
Mon Apr 16 17:51:59 PDT 2012


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 overaligned.)

-Eli




More information about the cfe-commits mailing list