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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Uros Bizjak <[email protected]>:

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

commit r16-9929-g5db2d73d79814bf5d2657da284b0913cd55025d7
Author: Uros Bizjak <[email protected]>
Date:   Mon Nov 2 22:50:30 2026 +0100

    i386: Emit ENDBR for cf_check functions that are only called directly

    The cf_check attribute documents that ENDBR is placed at function
    entry, but rest_of_insert_endbr_and_patchable_area skips ENDBR for
    functions where only_called_directly_p is true.  Honor cf_check
    unconditionally; nocf_check still takes precedence.

    Assisted-by: Claude Sonnet 5.5

            PR target/128360

    gcc/ChangeLog:

            * config/i386/i386-features.cc
            (rest_of_insert_endbr_and_patchable_area): Emit ENDBR for
            functions with cf_check attribute even when they are only
            called directly.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr128360-1.c: New test.
            * gcc.target/i386/pr128360-2.c: Ditto.
            * gcc.target/i386/pr128360-3.c: Ditto.

    (cherry picked from commit f2de25778e41d2a6451c798e58e0a6bb5af70765)

Reply via email to