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

--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
https://gcc.gnu.org/g:37c98fdeac7ae2f9649d49e0cfa2631c84a329da

commit r15-5748-g37c98fdeac7ae2f9649d49e0cfa2631c84a329da
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Nov 28 11:42:11 2024 +0100

    inline-asm, i386: Add "redzone" clobber support

    The following patch adds a "redzone" clobber (recognized everywhere,
    even on on targets which don't do anything with it),
    with which one can mark the rare case where inline asm pushes
    something on the stack or uses call instruction without taking
    red zone into account (i.e. addq $-128, %rsp; and addq $128, %rsp
    around that).

    2024-11-28  Jakub Jelinek  <ja...@redhat.com>

    gcc/
            * target.def (redzone_clobber): New target hook.
            * varasm.cc (decode_reg_name_and_count): Return -5 for
            "redzone".
            * cfgexpand.cc (expand_asm_stmt): Handle redzone clobber.
            * config/i386/i386.h (struct machine_function): Add
            asm_redzone_clobber_seen member.
            * config/i386/i386.cc (ix86_compute_frame_layout): Don't
            use red zone if cfun->machine->asm_redzone_clobber_seen.
            (ix86_redzone_clobber): New function.
            (TARGET_REDZONE_CLOBBER): Redefine.
            * doc/extend.texi (Clobbers and Scratch Registers): Document
            the "redzone" clobber.
            * doc/tm.texi.in: Add @hook TARGET_REDZONE_CLOBBER.
            * doc/tm.texi: Regenerate.
    gcc/testsuite/
            * gcc.dg/asm-redzone-1.c: New test.
            * gcc.target/i386/asm-redzone-1.c: New test.

Reply via email to