https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123206
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Alex Coplan <[email protected]>: https://gcc.gnu.org/g:0779f1312569b8da837fb744d62c35a3435e5aa3 commit r16-7172-g0779f1312569b8da837fb744d62c35a3435e5aa3 Author: Alex Coplan <[email protected]> Date: Fri Dec 19 13:51:04 2025 +0000 aarch64: Fix gating of fp8 intrinsics [PR123206] As it stands, there are several intrinsics in aarch64-simd-pragma-builtins.def which have the following form: #define REQUIRED_EXTENSIONS nonstreaming_only (TARGET_SIMD) [...] #undef REQUIRED_EXTENSIONS the problem being that nonstreaming_only expects an instance of aarch64_feature_flags which (statically) describes the required extensions for the intrinsics. Instead, we were passing TARGET_SIMD, which computes a boolean telling us dynamically whether the simd feature is currently available. This patch fixes the issue by simply doing s/TARGET_SIMD/AARCH64_FL_SIMD/ in that file. We also add a simple test which checks that we now diagnose the missing extension instead of ICEing when compiling with +nosimd. As an additional conservative hardening step (to prevent a similar issue from re-occurring), this patch adjusts the aarch64_pragma_builtins table to make it constexpr. This makes the bug a compile-time error. The next patch in the series adjusts the ctor of bbitmap to make it explicit (and deals with the fallout), this patch however is deliberately a minimal fix which is suitable for backporting. gcc/ChangeLog: PR target/123206 * config/aarch64/aarch64-builtins.cc (struct aarch64_pragma_builtins_data): Declare array as CONSTEXPR. * config/aarch64/aarch64-simd-pragma-builtins.def: Update incorrect uses of TARGET_SIMD to use AARCH64_FL_SIMD instead. gcc/testsuite/ChangeLog: PR target/123206 * gcc.target/aarch64/pr123206.c: New test.
