https://gcc.gnu.org/g:fbf3ff6bc169639a2d55ab4ed5f962201ad6416e
commit fbf3ff6bc169639a2d55ab4ed5f962201ad6416e Author: Michael Matz <m...@suse.de> Date: Thu Jul 11 15:21:05 2024 +0200 x86-ssw: Deal with deallocated frame in epilogue When the frame is deallocated separately we need to adjust frame_state.sp_offset to be correct before emitting the rest of the standard epilogue. Diff: --- gcc/config/i386/i386.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 8c9505d53a75..847c6116884b 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -9931,6 +9931,11 @@ ix86_expand_epilogue (int style) else restore_regs_via_mov = false; + /* If we've (de)allocated the frame separately, then that's done already, + and SP is in fact at a word offset. */ + if (m->frame_alloc_separately) + m->fs.sp_offset = UNITS_PER_WORD; + if (restore_regs_via_mov || frame.nsseregs) { /* Ensure that the entire register save area is addressable via