https://gcc.gnu.org/g:37dcc821a450f9e14aa0bc27b60ac1f8007fc183
commit r17-3184-g37dcc821a450f9e14aa0bc27b60ac1f8007fc183 Author: Alice Carlotti <[email protected]> Date: Wed Jul 15 18:54:21 2026 +0100 aarch64: Fix assert checking alias feature bits Adjust the assert in aarch64_get_extension_string_for_isa_flags to check that the isa_flags parameter has no alias bits set. This is the check I intended to use when adding the assert in r15-7196-gb53781ce1e49fc, but I accidentally checked the global aarch64_isa_flags value instead. Additionally, remove the cpuinfo feature string entries for alias features, so that the bits are left unset during host_detect_local_cpu. Setting the bits would trigger the fixed assert, but was otherwise harmless because aarch64_get_extension_string_for_isa_flags would ignore the value of those bits. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_get_extension_string_for_isa_flags): Check isa_flags. * config/aarch64/aarch64-option-extensions.def (CRYPTO, SVE2_AES, SVE2_BITPERM, SVE2_SHA3, SVE2_SM4): Remove cpuinfo feature string. Diff: --- gcc/common/config/aarch64/aarch64-common.cc | 2 +- gcc/config/aarch64/aarch64-option-extensions.def | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index fc7e84ae966c..d38ddb41c596 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -642,7 +642,7 @@ aarch64_get_extension_string_for_isa_flags /* The alias bits should only be used to support the aliases during option processing, and should be cleared at all other times. Verify this property for the supplied flags bitmask. */ - gcc_assert (!(feature_deps::alias_flags & aarch64_isa_flags)); + gcc_assert (!(feature_deps::alias_flags & isa_flags)); aarch64_feature_flags current_flags = default_arch_flags; /* As a special case, do not assume that the assembler will enable CRC diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def index 85483f38cc47..fbd5ea0d6e5a 100644 --- a/gcc/config/aarch64/aarch64-option-extensions.def +++ b/gcc/config/aarch64/aarch64-option-extensions.def @@ -150,7 +150,7 @@ AARCH64_FMV_FEATURE("aes", PMULL, (AES)) /* +nocrypto disables AES, SHA2 and SM4, and anything that depends on them (such as SHA3 and the SVE2 crypto extensions). */ AARCH64_OPT_EXTENSION_ALIAS("crypto", CRYPTO, (AES, SHA2), (), (AES, SHA2, SM4), - (AES, SHA2), "aes pmull sha1 sha2") + (AES, SHA2), "") AARCH64_OPT_EXTENSION("sha3", SHA3, (SHA2), (), (), "sha3 sha512") @@ -209,26 +209,26 @@ AARCH64_OPT_FMV_EXTENSION("sve2", SVE2, (SVE), (), (), "sve2") AARCH64_OPT_EXTENSION("sve-aes", SVE_AES, (AES), (), (), "sveaes | smeaes") -AARCH64_OPT_EXTENSION_ALIAS("sve2-aes", SVE2_AES, (SVE2, SVE_AES), (), (SVE_AES), (SVE_AES), "sveaes") +AARCH64_OPT_EXTENSION_ALIAS("sve2-aes", SVE2_AES, (SVE2, SVE_AES), (), (SVE_AES), (SVE_AES), "") AARCH64_FMV_FEATURE("sve2-aes", SVE_PMULL128, (SVE2, SVE_AES)) AARCH64_OPT_EXTENSION("sve-bitperm", SVE_BITPERM, (), (), (), "svebitperm | smesbitperm") AARCH64_OPT_EXTENSION_ALIAS("sve2-bitperm", SVE2_BITPERM, (SVE2, SVE_BITPERM), (), (SVE_BITPERM), - (SVE_BITPERM), "svebitperm") + (SVE_BITPERM), "") AARCH64_FMV_FEATURE("sve2-bitperm", SVE_BITPERM, (SVE2, SVE_BITPERM)) AARCH64_OPT_EXTENSION("sve-sha3", SVE_SHA3, (SHA3), (), (), "svesha3") -AARCH64_OPT_EXTENSION_ALIAS("sve2-sha3", SVE2_SHA3, (SVE2, SVE_SHA3), (), (SVE_SHA3), (SVE_SHA3), "svesha3") +AARCH64_OPT_EXTENSION_ALIAS("sve2-sha3", SVE2_SHA3, (SVE2, SVE_SHA3), (), (SVE_SHA3), (SVE_SHA3), "") AARCH64_FMV_FEATURE("sve2-sha3", SVE_SHA3, (SVE2, SVE_SHA3)) AARCH64_OPT_EXTENSION("sve-sm4", SVE_SM4, (SM4), (), (), "svesm4") -AARCH64_OPT_EXTENSION_ALIAS("sve2-sm4", SVE2_SM4, (SVE2, SVE_SM4), (), (SVE_SM4), (SVE_SM4), "svesm4") +AARCH64_OPT_EXTENSION_ALIAS("sve2-sm4", SVE2_SM4, (SVE2, SVE_SM4), (), (SVE_SM4), (SVE_SM4), "") AARCH64_FMV_FEATURE("sve2-sm4", SVE_SM4, (SVE2, SVE_SM4))
