[LLVMdev] Vector troubles

Daniel Berlin dberlin at dberlin.org
Sat Sep 29 19:33:23 PDT 2007


We force 16 byte alignment in main, and keep it through all gcc
compiled functions.

glibc < 2.4 don't reliably keep stack at 16 bytes through some calls
(qsort, etc), but otherwise, it stays 16 byte aligned.

On 9/29/07, Evan Cheng <evan.cheng at apple.com> wrote:
> What is gcc's caller stack alignment assumption on Linux? Unless it's
> 16 byte or more, the callee will have to dynamically align the stack.
>
> Evan
>
> On Sep 28, 2007, at 5:49 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
>
> > On 9/28/07, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> >> Chuck,
> >>
> >>> It is dying trying to store a our working vector into one of the
> >>> LLVM
> >>> vectors created on the stack.  Despite the align-16 directive on the
> >>> alloca instruction, it is not always aligning to a 16-byte boundary.
> >> The stack is not necessary 16 bytes aligned on linux/windows.
> >
> > On recent versions of linux (anything in the past 2 years), the stack
> > will be aligned by gcc, the kernel, and glibc, in all the right
> > functions.
> >
> > So unless you misalign it, ...
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list