https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84248
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
I am testing this patch
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6c612c77987..1fa8bebca1d 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4915,7 +4915,7 @@ ix86_option_override_internal (bool main_args_p,
/* Do not support control flow instrumentation if CET is not enabled. */
if (opts->x_flag_cf_protection != CF_NONE)
{
- switch (flag_cf_protection)
+ switch ((flag_cf_protection & ~CF_SET))
{
case CF_NONE:
break;