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

--- Comment #42 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by H.J. Lu <h...@gcc.gnu.org>:

https://gcc.gnu.org/g:5d928740a533cd9e78673fad7ea86d20b2142277

commit r11-9576-g5d928740a533cd9e78673fad7ea86d20b2142277
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Wed Oct 27 06:27:15 2021 -0700

    x86: Add -mindirect-branch-cs-prefix

    Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to
    indirect thunk with branch target in r8-r15 registers so that the call
    and jmp instruction length is 6 bytes to allow them to be replaced with
    "lfence; call *%r8-r15" or "lfence; jmp *%r8-r15" at run-time.

    gcc/

            PR target/102952
            * config/i386/i386.c (ix86_output_jmp_thunk_or_indirect): Emit
            CS prefix for -mindirect-branch-cs-prefix.
            (ix86_output_indirect_branch_via_reg): Likewise.
            * config/i386/i386.opt: Add -mindirect-branch-cs-prefix.
            * doc/invoke.texi: Document -mindirect-branch-cs-prefix.

    gcc/testsuite/

            PR target/102952
            * gcc.target/i386/indirect-thunk-cs-prefix-1.c: New test.
            * gcc.target/i386/indirect-thunk-cs-prefix-2.c: Likewise.

    (cherry picked from commit 2196a681d7810ad8b227bf983f38ba716620545e)

Reply via email to