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

Renato Golin renato.golin at linaro.org
Tue Feb 4 02:04:29 PST 2014


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.

Though, I'd have thought, naively, that the padding is just (Align - Args).
I'm probably missing something...

--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140204/b75ea133/attachment.html>


More information about the llvm-commits mailing list