http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60107
--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot
Uni-Bielefeld.DE> ---
> --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Well, this isn't about main alignment (and, after all, main realigns the stack
> anyway), but about stack alignment upon entering pthread_create callbacks.
> If the Solaris libraries don't maintain 16-byte stack alignment, then either
> you could arrange to compile parts of libgomp with -mincoming-stack-boundary=2
> (or -mstackrealign) on Solaris/i?86 32-bit. Or just make sure the default on
> Solaris is -mincoming-stack-boundary=2 or whatever the libraries do guarantee.
I've checked the Solaris 9 and OpenSolaris sources: on S9, there's just
the 4-byte alignment guaranteed by the i386 psABI. On S10 and up, they
enforce 16-byte alignment for the benefit of SSE.
IMO, the best (most general) solution is to change STACK_REALIGN_DEFAULT
to 1 on Solaris 9/x86. While it comes at a performance and code size
penalty, it's guaranteed to be correct.
I've bootstrapped a patch to do just that and as expected, the libgomp
failures are gone.
Unlike I'm overlooking something important, I'd like to check this patch
into mainline for 4.9.0.
Rainer