https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128373
--- Comment #9 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:443b39eb2e3dfa986faa1a5fa7576fd3c001dbd2 commit r17-6177-g443b39eb2e3dfa986faa1a5fa7576fd3c001dbd2 Author: Uros Bizjak <[email protected]> Date: Wed Nov 11 07:27:55 2026 +0000 i386: Do not treat -fcf-protection=check as CET in D [PR128373] -fcf-protection=check is ignored at compile time, but it sets flag_cf_protection to CF_CHECK | CF_SET. The D front end therefore defined the GNU_CET version identifier and returned 8 from __traits(getTargetInfo, "CET") even though neither IBT nor SHSTK is enabled. Define GNU_CET only when CF_BRANCH or CF_RETURN is set, and return only those bits from getTargetInfo ("CET"), as already done for __CET__ in the C family front ends. Assisted-by: Claude Sonnet 5.5 PR target/128373 gcc/ChangeLog: * config/i386/i386-d.cc (ix86_d_target_versions): Define GNU_CET only when CF_BRANCH or CF_RETURN is set. (ix86_d_handle_target_cf_protection): Return only the CF_BRANCH and CF_RETURN bits. gcc/testsuite/ChangeLog: * gdc.dg/target/i386/targetinfo_CET.d: Check for the exact value 3 and for GNU_CET. * gdc.dg/target/i386/targetinfo_CET_check.d: New test.
