http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46094
Summary: -fsplit-stack doesn't honour x86_64 ABI wrt. stack alignment Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: zso...@seznam.cz If I understand http://www.x86-64.org/documentation/abi.pdf correctly, and the ABI described here is valid enough, -fsplit-stack doesn't align stack correctly when calling functions. At the moment of function entry, this should hold: (rsp&15)==8 As example, I will use the testcase from PR46093 ( http://gcc.gnu.org/bugzilla/attachment.cgi?id=22091 ). There are values of rsp at the moment of function entry: GDB breakpoints: b main b foo b __morestack b __morestack_block_signals b __generic_morestack b __morestack_unblock_signals b __generic_releasestack b pthread_sigmask b sigprocmask (for some reason, breakpoint at __morestack wasn't set correctly by this procedure, so I had to set it manually) function rsp main 0x7fffffffde58 __morestack 0x7fffffffde50 __morestack_block_signals 0x7fffffffddf0 sigprocmask 0x7fffffffddf0 __generic_morestack 0x7fffffffde00 __morestack_unblock_signals 0x7ffff7ff9ff8 sigprocmask 0x7ffff7ff9ff8 foo 0x7ffff7ff5fe8 ... this could cause problem if (for example) sigprocmask() used SSE instructions to access stack