https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111107
--- Comment #6 from Zebediah Figura <zfigura at codeweavers dot com> --- (In reply to Zebediah Figura from comment #4) > (In reply to Andrew Pinski from comment #3) > > https://inbox.sourceware.org/gcc-patches/5969976.Bvae8NF9fS@polaris/ > > Again, I'm not sure what you're trying to communicate here. I'm aware that > -mstackrealign exists (and its attribute equivalent). We *do* use that in > Wine. Ah, I'm sorry, I think I see what you're trying to say—that it was an intentional choice to add -mstackrealign if -msse2 is used, so it's hard to call this a "bug" per se. (In reply to Richard Biener from comment #5) > I'd say that > > config/i386/cygming.h:#define STACK_REALIGN_DEFAULT TARGET_SSE > > is a non-working "fix". The appropriate default would be > -mincoming-stack-boundary=2. MIN_STACK_BOUNDARY should already be 4, so > that leaves PREFERRED_STACK_BOUNDARY_DEFAULT is the way to go here. I also > see > > /* It should be MIN_STACK_BOUNDARY. But we set it to 128 bits for > both 32bit and 64bit, to support codes that need 128 bit stack > alignment for SSE instructions, but can't realign the stack. */ > #define PREFERRED_STACK_BOUNDARY_DEFAULT \ > (TARGET_IAMCU ? MIN_STACK_BOUNDARY : 128) > > which suggests there might be problems with SSE anyway. > > So does the following work? But I would agree with this, yeah. If we're going to manually align for SSE then we should also manually align for types that need to be manually aligned. Which means that we should just have -mincoming-stack-boundary=2 everywhere. In theory that patch works, although I'll have to put together a gcc build to be sure. I do have one question, though... from reading the documentation, I have a hard time understanding the difference, or intended difference, between -mincoming-stack-boundary and -mpreferred-stack-boundary. Could you by chance try to clarify?