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

--- Comment #41 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> This reads to me like `-mstackrealign` usually decreases
> `incoming_stack_boundary` from 128 to 32; realignment is actually a result
> of that, right?

Yes, both -mstackrealign and force_align_arg_pointer work by decreasing
incoming_stack_boundary, which later causes the realignment if a larger
alignment is required on the stack.  -mstackrealign does it for all functions
that require 16-byte alignment, whereas force_align_arg_pointer does it for
marked functions only but for all required alignments.

> Is it right to say 'it has no effects for 8-byte alignment' because it's
> 8-byte alignment that the function is asking for, which is not 16?

Yes.

> Because we want to decrease the preferred alignment to 4 bytes,
> `incoming_stack_boundary` will be 32, which is same as MIN_STACK_BOUNDARY,
> and the code above will not have an effect any more. Does it make sense to
> remove `STACK_REALIGN_DEFAULT` from cygming.h?

Yes, I think that, if the default incoming_stack_boundary is changed, then
STACK_REALIGN_DEFAULT should be removed altogether.  My understanding is that
they are mutually exclusive mechanisms.

Reply via email to