https://bugs.winehq.org/show_bug.cgi?id=55470
--- Comment #7 from Stefan Dösinger stefan@codeweavers.com --- There are a lot of compiler alignment related bugs. I am not opposed to closing this one (or others) as duplicates. How the compiler ends up generating alignment dependent code (either by explicit request like in my C sample or via SSE) is I think less important than that gcc uses the wrong defaults when targeting x86 Windows.
One thing I noticed in my investigation is that -march=pentium3 (or newer, though apparently not znver4) makes the compiler realign the stack in my example. I looked into this because I know Crossover's 32 bit DLLs are built with -mfpmath=sse -march=core2. The SSE instructions generated by this happen to work because of that -march argument.
Note that just having an SSE instruction doesn't mean the code crashes when the stack is misaligned - if e.g. a function only runs SSE operations on data passed in as function arguments it won't care about the stack alignment.