https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114606
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:b8b148bc22673689fda19711b428b544462be2e4 commit r14-9903-gb8b148bc22673689fda19711b428b544462be2e4 Author: Marek Polacek <pola...@redhat.com> Date: Fri Apr 5 12:37:19 2024 -0400 target: missing -Whardened with -fcf-protection=none [PR114606] -Whardened warns when -fhardened couldn't enable a hardening option because that option was disabled on the command line, e.g.: $ ./cc1plus -quiet g.C -fhardened -O2 -fstack-protector cc1plus: warning: '-fstack-protector-strong' is not enabled by '-fhardened' because it was specified on the command line [-Whardened] but it doesn't work as expected with -fcf-protection=none: $ ./cc1plus -quiet g.C -fhardened -O2 -fcf-protection=none because we're checking == CF_NONE which doesn't distinguish between nothing and -fcf-protection=none. I should have used opts_set, like below. PR target/114606 gcc/ChangeLog: * config/i386/i386-options.cc (ix86_option_override_internal): Use opts_set rather than checking == CF_NONE. gcc/testsuite/ChangeLog: * gcc.target/i386/fhardened-1.c: New test. * gcc.target/i386/fhardened-2.c: New test. Reviewed-by: Jakub Jelinek <ja...@redhat.com>