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.

Reply via email to