https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112108
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Carlotti <acarlo...@gcc.gnu.org>: https://gcc.gnu.org/g:4e1b617b35631df4dd6089d4044aa19d0c1adea7 commit r15-3024-g4e1b617b35631df4dd6089d4044aa19d0c1adea7 Author: Andrew Carlotti <andrew.carlo...@arm.com> Date: Tue Jul 18 20:09:38 2023 +0100 aarch64: Fix memtag intrinsic availability The availability of memtag intrinsics and data types were determined solely by the globally specified architecture features, which did not reflect any changes specified in target pragmas or attributes. This patch removes the initialisation-time guards for the intrinsics, and replaces them with checks at use time. It also removes the macro indirection from the header file - this simplifies the header, and allows the missing extension error reporting to find the user-facing intrinsic names. gcc/ChangeLog: PR target/112108 * config/aarch64/aarch64-builtins.cc (aarch64_init_memtag_builtins): Define intrinsic names directly. (aarch64_general_init_builtins): Move memtag intialisation... (handle_arm_acle_h): ...to here, and remove feature check. (aarch64_general_check_builtin_call): Check memtag intrinsics. * config/aarch64/arm_acle.h (__arm_mte_create_random_tag) (__arm_mte_exclude_tag, __arm_mte_ptrdiff) (__arm_mte_increment_tag, __arm_mte_set_tag, __arm_mte_get_tag): Remove. gcc/testsuite/ChangeLog: PR target/112108 * gcc.target/aarch64/acle/memtag_guard-1.c: New test. * gcc.target/aarch64/acle/memtag_guard-2.c: New test. * gcc.target/aarch64/acle/memtag_guard-3.c: New test. * gcc.target/aarch64/acle/memtag_guard-4.c: New test.