aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-08-04 21:47:57 +1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-11 23:25:09 +0000
commit5a2d86939c735ca2e9aba68c534bffe763a8f7a6 (patch)
tree02ad28e7427645f9c9f7a793afccd9a4981cdf25
parent21d94bf16f124e22fc7ad3c2e4083374eba03c67 (diff)
downloadgcc-5a2d86939c735ca2e9aba68c534bffe763a8f7a6.zip
gcc-5a2d86939c735ca2e9aba68c534bffe763a8f7a6.tar.gz
gcc-5a2d86939c735ca2e9aba68c534bffe763a8f7a6.tar.bz2
aarch64: Disable TARGET_CMPBR with aarch64_track_speculation
With -mtrack-speculation, CC_REGNUM must be used at every conditional branch. gcc: * config/aarch64/aarch64.h (TARGET_CMPBR): False when aarch64_track_speculation is true.
-rw-r--r--gcc/config/aarch64/aarch64.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 096c853..2b3610c 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -410,8 +410,9 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE ATTRIBUTE_UNUSED
/* CSSC instructions are enabled through +cssc. */
#define TARGET_CSSC AARCH64_HAVE_ISA (CSSC)
-/* CB<cc> instructions are enabled through +cmpbr. */
-#define TARGET_CMPBR AARCH64_HAVE_ISA (CMPBR)
+/* CB<cc> instructions are enabled through +cmpbr,
+ but are incompatible with -mtrack-speculation. */
+#define TARGET_CMPBR (AARCH64_HAVE_ISA (CMPBR) && !aarch64_track_speculation)
/* Make sure this is always defined so we don't have to check for ifdefs
but rather use normal ifs. */