This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libffi doesn't keep the stack aligned to 16 bytes


Hi

Neil Roberts <neil@linux.intel.com> wrote:

> GCC appears to assume by default that the stack is always aligned to 16
> bytes when entering a function. Presumably this is to make it easier to
> use the aligned access instructions to load data into SSE
> registers. This means that if you have a variable with the aligned(16)
> attribute then GCC knows that it doesn't have to add an extra
> instruction to align the stack pointer because it will already be
> aligned.
> 
> However, libffi doesn't appear to respect this. When it calls a function
> it allocates space on the stack by decrementing the stack pointer
> according to the amount of space required. This means the depending on
> the number of arguments the stack may or may not be aligned.

I wasn't subscribed to this list so I didn't see the replies to my
email. Sorry about that. It looks like the patch has now been applied
which is great, thanks. Just a small complaint however that I think a
lot of contributors would appreciate it if you could retain the commit
message and authorship when merging patches to git master instead of
combining them all into one commit.

Regards,
- Neil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]