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

--- Comment #6 from Haochen Jiang <haochen.jiang at intel dot com> ---
I am testing a patch with this fix:

diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 3467ab0bbeb..f2c536d1e33 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -2711,6 +2711,7 @@ ix86_option_override_internal (bool main_args_p,
                        "using 512 as max vector size");
        }
       else if (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
+              && (opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_AVX512F)
               && !(OPTION_MASK_ISA2_EVEX512
                    & opts->x_ix86_isa_flags2_explicit))
        warning (0, "Vector size conflicts between AVX10.1 and AVX512, using "
@@ -2751,10 +2752,11 @@ ix86_option_override_internal (bool main_args_p,
     }

   /* Set EVEX512 if one of the following conditions meets:
-     1. AVX512 is enabled while EVEX512 is not explicitly set/unset.
+     1. AVX512 is explicitly enabled while EVEX512 is not explicitly
set/unset.
      2. AVX10.1-512 is enabled.  */
   if (TARGET_AVX10_1_512_P (opts->x_ix86_isa_flags2)
       || (TARGET_AVX512F_P (opts->x_ix86_isa_flags)
+         && (opts->x_ix86_isa_flags_explicit & OPTION_MASK_ISA_AVX512F)
          && !(opts->x_ix86_isa_flags2_explicit & OPTION_MASK_ISA2_EVEX512)))
     opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_EVEX512;

Reply via email to