]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH 5/15] arm: Implement target feature macros for PACBTI
authorAndrea Corallo <andrea.corallo@arm.com>
Mon, 6 Dec 2021 10:39:59 +0000 (11:39 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Fri, 19 Aug 2022 13:22:57 +0000 (15:22 +0200)
commit7b633a97858dbac4c77a2223dcbde78642aa3251
treef0553429df17ae70f763d955e71b24af2cf32e83
parenta803ebd8be60cccd23ef5bb5013202610b032a66
[PATCH 5/15] arm: Implement target feature macros for PACBTI

This patch implements target feature macros when PACBTI is enabled
through the -march option or -mbranch-protection.  The target feature
macros __ARM_FEATURE_PAC_DEFAULT and __ARM_FEATURE_BTI_DEFAULT are
specified in ARM ACLE
<https://developer.arm.com/documentation/101028/0012/5--Feature-test-macros?lang=en>
__ARM_FEATURE_PAUTH and __ARM_FEATURE_BTI are specified in the
pull-request <https://github.com/ARM-software/acle/pull/55>.

Approved here
<https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586334.html>.

gcc/

* config/arm/arm-c.c (arm_cpu_builtins): Define
__ARM_FEATURE_BTI_DEFAULT, __ARM_FEATURE_PAC_DEFAULT,
__ARM_FEATURE_PAUTH and __ARM_FEATURE_BTI.

gcc/testsuite/

* lib/target-supports.exp
(check_effective_target_mbranch_protection_ok): New function.
* gcc.target/arm/acle/pacbti-m-predef-2.c: New test.
* gcc.target/arm/acle/pacbti-m-predef-4.c: Likewise.
* gcc.target/arm/acle/pacbti-m-predef-5.c: Likewise.
* gcc.target/arm/acle/pacbti-m-predef-8.c: Likewise.
* gcc.target/arm/acle/pacbti-m-predef-9.c: Likewise.
* gcc.target/arm/acle/pacbti-m-predef-10.c: Likewise.
* gcc.target/arm/acle/pacbti-m-predef-11.c: Likewise.
* gcc.target/arm/acle/pacbti-m-predef-12.c: Likewise.

Co-Authored-By: Tejas Belagod <tbelagod@arm.com>
gcc/config/arm/arm-c.cc
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-9.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp