https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88917
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Other option is to spend a lot of energy on this. output_indirect_thunk would need to be told if it is emitted inside of normal functions or in the magic functions where it currently does the right thing already, for the normal functions walk back from current_output_insn (perhaps with some caching) to find out the previous NOTE_INSN_CFI that was already emitted, find corresponding entry in cfun->dw_fde_cfi vector, interpret the CFI instructions from the beginning until that point to figure out if the current CFA is stack pointer or something else and only if it is stack pointer, add the cfi stuff in there and undo it later. Furthermore, I see e.g. ix86_output_indirect_branch_via_push is emitting push instructions, that is again a big no no unless you adjust unwind info too.