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

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

https://gcc.gnu.org/g:d91fa5f258a62488abfed07dad608160e0a40d29

commit r16-6309-gd91fa5f258a62488abfed07dad608160e0a40d29
Author: Jakub Jelinek <[email protected]>
Date:   Sat Dec 20 11:59:19 2025 +0100

    i386: Fix up handling of some -mno-avx512* options [PR123216]

    This PR is about -mavx10.2 -mno-avx512vl ICE on some builtin.
    Though, because -mavx10.2 implies -mavx512vl (among many others), the
    pattern is right and doesn't need to care about such weird cases.

    What is wrong is the handling of -mno-avx512vl and various other options,
    that should unset -mavx10.1 and that should unset -mavx10.2, but it
doesn't.

    I went through various ISAs which 10.1 or 10.2 implies, looking for the
    ISA{,2}_*_SET and corresponding ISA{,2}_*_UNSET macros and their use or
lack
    thereof.
    Here is what I found.
    OPTION_MASK_ISA_AVX512FP16_UNSET has been incorrectly defined (avx512fp16
    implies avx512bw, not the other way around), but fortunately wasn't used.
    And then various ISAs implied by -mavx10.1 (except for -mavx512f which was
    correct) missed clearing -mavx10.{1,2} on -mno-* handling.

    As mentioned in the PR, it would be really nice to add some verification of
    the set and unset macros to verify consistency.

    2025-12-20  Jakub Jelinek  <[email protected]>

            PR target/123216
            * common/config/i386/i386-common.cc
(OPTION_MASK_ISA_AVX512FP16_UNSET):
            Remove unused macro.
            (OPTION_MASK_ISA2_AVX512FP16_UNSET,
OPTION_MASK_ISA2_AVX512BF16_UNSET,
            OPTION_MASK_ISA2_AVX512BW_UNSET): Or in
OPTION_MASK_ISA2_AVX10_1_UNSET.
            (OPTION_MASK_ISA2_AVX512CD_UNSET, OPTION_MASK_ISA2_AVX512DQ_UNSET,
            OPTION_MASK_ISA2_AVX512VL_UNSET, OPTION_MASK_ISA2_AVX512IFMA_UNSET,
            OPTION_MASK_ISA2_AVX512VNNI_UNSET,
            OPTION_MASK_ISA2_AVX512VPOPCNTDQ_UNSET,
            OPTION_MASK_ISA2_AVX512VBMI_UNSET,
OPTION_MASK_ISA2_AVX512VBMI2_UNSET,
            OPTION_MASK_ISA2_AVX512BITALG_UNSET): Define.
            (ix86_handle_option): For
            -mno-avx512{cd,dq,vl,ifma,vnni,vpopcntdq,vbmi,vbmi2,bitalg} also
remove
            corresponding OPTION_MASK_ISA2_AVX512*_UNSET from ix86_isa_flags2
            and add it to ix86_isa_flags2_explicit.

Reply via email to