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

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

https://gcc.gnu.org/g:8855f0622a8491b40deb79d29fcd8739c9287562

commit r17-5903-g8855f0622a8491b40deb79d29fcd8739c9287562
Author: Uros Bizjak <[email protected]>
Date:   Tue Nov 3 13:13:34 2026 +0100

    i386: Do not define __CET__ for -fcf-protection=check [PR128373]

    -fcf-protection=check is ignored at compile time, but it sets
    flag_cf_protection to CF_CHECK | CF_SET, so ix86_target_macros defined
    __CET__=8 even though neither IBT nor SHSTK is enabled.  Assembly files
    including <cet.h> then emitted a GNU_PROPERTY_X86_FEATURE_1_AND note
    with a zero value.

    Define __CET__ only when CF_BRANCH or CF_RETURN is set, and expose
    only those bits in its value.

    Assisted-by: Claude Sonnet 5.5

            PR target/128373

    gcc/ChangeLog:

            * config/i386/i386-c.cc (ix86_target_macros):
            Define __CET__ only when CF_BRANCH or CF_RETURN is set.

    gcc/testsuite/ChangeLog:

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

Reply via email to