[PATCH] Use 16 byte stack alignment for NaCl on ARM, and fix a varargs bug

Mark Seaborn mseaborn at chromium.org
Tue Feb 11 14:37:07 PST 2014


On 4 February 2014 02:04, Renato Golin <renato.golin at linaro.org> wrote:

> On 4 February 2014 09:50, Stepan Dyatkovskiy <stpworld at narod.ru> wrote:
>
>> unsigned Padding =
>>   ((ArgRegsSize + AFI->getArgRegsSaveSize() + Align - 1) & ~(Align-1)) -
>>   (ArgRegsSize + AFI->getArgRegsSaveSize());
>>
>> It works only if Align is power of 2. It fails for Align == 24 for
>> example. So we need to check it then..
>>
>
> It seems to work for all powers of two, and it's a good assert to check if
> Align is a power of 2, so we should be safe for now.
>

How about using OffsetToAlignment() so that the alignment arithmetic isn't
open-coded?  This happens to support non-powers-of-2.  I've changed
http://llvm-reviews.chandlerc.com/D2677 to use that.

Cheers,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140211/f036a8e8/attachment.html>


More information about the llvm-commits mailing list