This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug rtl-optimization/67856] callee-saved register saves should be shrink-wrapped


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67856

--- Comment #4 from Andy Lutomirski <luto at mit dot edu> ---
I don't want to comment on how code generation works in GCC, but in terms of
what works in the output:

x86_64 generally has a 16-byte stack alignment in user code, which is two
slots.  (In the kernel, we use 8-byte alignment, since we don't use SSE/AVX.) 
This means that the stack is always aligned appropriately.

For builds with frame pointers on, merely pushing %rbp aligns the stack, so
splitting out the 'push %rbp' from the rest of the pushes doesn't leave an
unaligned window.

With frame pointers off, doing any odd number of pushes will similarly align
the stack.

For functions in which there's a control flow path from the beginning to the
end that call nothing, then the alignment is irrelevant unless there's a
16-byte or higher aligned live variable on the stack.


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