This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81646] i386 SSE2 compilation mode which preserves psABI stack alignment without requiring it
- From: "fw at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Aug 2017 15:39:15 +0000
- Subject: [Bug target/81646] i386 SSE2 compilation mode which preserves psABI stack alignment without requiring it
- Auto-submitted: auto-generated
- References: <bug-81646-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81646
--- Comment #3 from Florian Weimer <fw at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> The Linux ABI says the stack should be 16-byte alignment, anything else is a
> bug.
The GCC manual recommends this (under -mincoming-stack-boundary):
This extra alignment does consume extra stack space, and generally
increases code size. Code that is sensitive to stack space usage,
such as embedded systems and operating system kernels, may want to
reduce the preferred alignment to '-mpreferred-stack-boundary=2'.
It doesn't note the ABI impact, so the sorry situation is part our fault.
> That said, one can use -mpreferred-stack-boundary=,
> -mincoming-stack-boundary= and/or -mstackrealign options to tune stuff as
> desired.
Based on the gcc-help discussion,
https://gcc.gnu.org/ml/gcc-help/2017-07/msg00087.html
no combination of these options work. Stack alignment on every function entry
is much too expensive.