]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Disable TARGET_CMPBR with aarch64_track_speculation
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 4 Aug 2025 11:47:57 +0000 (21:47 +1000)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 11 Aug 2025 23:25:09 +0000 (23:25 +0000)
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.

gcc/config/aarch64/aarch64.h

index 096c853af7ff0215c49da42f1991b0af53cddeab..2b3610c86ed55d3cd3057a736f67abb57a10dcf6 100644 (file)
@@ -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.  */