I meant if you build a library on MinGW with the intent to have it loadable by any code—on Windows, natively. You don't control the caller's alignment or whoever uses your library. Wouldn't this be a much more widespread issue in such case?
It would require the library to (a) distribute binaries prebuilt with MinGW (which I get the impression is rare compared to building them with MSVC, even in the Free Software world), (b) manually use SSE or aligned types, (c) *not* build their libraries with -msse2 or anything.
And for all we know, maybe it *is* a widespread issue, and all of those libraries just end up using -mstackrealign or something.
-mpreferred-stack-boundary is how you want to keep the stack in our own functions, i.e. how they "prefer" it. I think it should also be set to 2 to prevent pointless realignments unless necessary. (note that realignment should happen if required by the function, already)
See, that's what it sounds like just from the name, but then why is there a warning about ABI in the documentation? Why would setting it, as Richard Biener suggests, make a difference? And for that matter, a truly static function that isn't exposed as a function pointer doesn't need to *have* an ABI; the compiler can and will pass the parameters however it feels like.