https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
Katsunori Kumatani <katsunori.kumatani at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katsunori.kumatani at gmail dot co | |m --- Comment #24 from Katsunori Kumatani <katsunori.kumatani at gmail dot com> --- I think this bug should be reopened because the current behavior is restricting. Andy is right. The compiler should be a tool and the developer using it should be allowed to shoot himself in the foot if that's what he wants. In this particular case it restricts freedom and the compiler should be the developer's tool not the other way around. Simply remove the TARGET_SSE check and let the actual developer decide if he wants the stack realigned instead of the compiler? There's even an attribute for that (to force stack realignment). I don't understand why such a check is even there, it servers NO purpose except to imply that the compiler knows better than the person using it, which is just wrong -- if someone wants to use SSE *and* 8-byte aligned stack, then let him do it. This will simply force GCC to realign the stack if and *only if* it needs to use an aligned SSE variable on the stack, just as it does with AVX already. So if 99% of your functions *do not* use SSE, they won't use 16-byte alignment. For that odd function that does use aligned SSE (or AVX), it will simply realign the stack to 16 or 32-bytes in that function's prolog. Nothing special and it won't crash. (as long as you don't call into library functions obviously) Just let the developer decide please, without having to recompile a custom modified GCC to remove that check that screams "I'm the compiler and I know better than you do what your code needs"...