https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58372
--- Comment #22 from xuepeng guo <xuepeng.guo at intel dot com> --- (In reply to Uroš Bizjak from comment #20) > Created attachment 44928 [details] > Proposed patch > > It turned out that functions, called directly through emit_library_call (as > the above testcase, which builds call to _Unwind_SjLj_Register from > sjlj_emit_function_enter) miss a whole lot of stack realignmnet setup. There > is an update to crtl->preferred_stack_boundary, but several updates for > SUPPORTS_STACK_ALIGNMENT targets are missing, including eventual DRAP setup. > > Attached patch fixes the path through emit_library_call. > > Can someone please test the patch on SJLJ target? On an x86_64 Linux platform, I simply configured gcc with command: ../gcc/configure --enable-sjlj-exceptions Then with Uroš's patch, the gcc bootstrap has no problem and the case can be successfully compiled. I am doing the gcc regression test to make sure there is no regression with Uroš's patch, it will take some time to finish. I am also attempting to cross-build for i686-w64-mingw32 to verify for Comment #14. If I am missing something, please let me know. Thanks very much.