https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111107
--- Comment #24 from LIU Hao <lh_mouse at 126 dot com> --- (In reply to Zeb Figura from comment #23) > Only partly. The example in the initial code is fixed. However, if you > change it to aligned(8) instead of aligned(16), it no longer aligns. See > comment 17. > > Using PREFERRED_STACK_BOUNDARY_DEFAULT instead of STACK_REALIGN_DEFAULT > would have fixed this, but maybe this is supposed to be considered a bug > with -mstackrealign. I don't know. I've asked multiple times what the > difference between the two is actually supposed to be, without answer. Isn't the answer exactly https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111107#c9 ? In i386-options.cc there's ix86_default_incoming_stack_boundary = PREFERRED_STACK_BOUNDARY; Would it make any sense to decrease the preferred stack boundary to `32` (like below)? Maybe it's too late, but Microsoft code has always been assuming 4-byte alignment, thus a 16-byte alignment is always unpredictable. #undef PREFERRED_STACK_BOUNDARY_DEFAULT #define PREFERRED_STACK_BOUNDARY_DEFAULT \ (TARGET_64BIT ? 128 : MIN_STACK_BOUNDARY)