[Bug target/79793] Incorrect stack alignment for interrupt handler in 64-bit

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jul 25 11:01:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79793

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 41826
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41826&action=edit
Adjust INCOMING_FRAME_SP_OFFSET for TYPE_EXCEPTION functions

How about something like attached patch? The patch adjusts
INCOMING_FRAME_SP_OFFSET of an exception handler to 2 * UNITS_PER_WORD.

The resulting code reads:

        .cfi_startproc
        subq    $392, %rsp
        .cfi_def_cfa_offset 400
        fxsave64        -120(%rsp)
        addq    $400, %rsp
        .cfi_def_cfa_offset 0
        iretq
        .cfi_endproc

Patch is otherwise untested. Probably, function argument parsing code has to be
adjusted as well. I'm also not sure if all .cfi directives are correct.


More information about the Gcc-bugs mailing list