[gcc r17-2498] aarch64: deprecate the TME extension

Richard Earnshaw via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:17f084306c68c437b1350682bcde6075ae749f15

commit r17-2498-g17f084306c68c437b1350682bcde6075ae749f15
Author: Richard Earnshaw <[email protected]>
Date:   Tue Jul 7 17:14:07 2026 +0100

    aarch64: deprecate the TME extension
    
    Arm has sunset the TME extension from the aarch64 architecture since
    there are no known implementations.  Since this has been present in the
    compiler for a while though, we need to go through a deprecation cycle.
    
    This patch starts that process by:
     - removing it from the documentation
     - warning if the option is used during compilation
     - removing the tests for it.
    
    gcc/ChangeLog:
    
            * config/aarch64/aarch64.cc (aarch64_override_options): Warn if
            +tme is used as an architecture feature
            (aarch64_process_target_attr): Similarly, but only if TME
            was previously disabled.
            * doc/invoke.texi (aarch64): Remove mentions of +tme.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/aarch64/pragma_cpp_predefs_2.c: Drop tests for TME.
            * gcc.target/aarch64/acle/tme.c: Removed.
            * gcc.target/aarch64/acle/tme_guard-1.c: Removed.
            * gcc.target/aarch64/acle/tme_guard-2.c: Removed.
            * gcc.target/aarch64/acle/tme_guard-3.c: Removed.
            * gcc.target/aarch64/acle/tme_guard-4.c: Removed.

Diff:
---
 gcc/config/aarch64/aarch64.cc                      |  9 ++++++
 gcc/doc/invoke.texi                                |  2 --
 gcc/testsuite/gcc.target/aarch64/acle/tme.c        | 34 ----------------------
 .../gcc.target/aarch64/acle/tme_guard-1.c          |  9 ------
 .../gcc.target/aarch64/acle/tme_guard-2.c          | 10 -------
 .../gcc.target/aarch64/acle/tme_guard-3.c          |  9 ------
 .../gcc.target/aarch64/acle/tme_guard-4.c          | 10 -------
 .../gcc.target/aarch64/pragma_cpp_predefs_2.c      | 12 --------
 8 files changed, 9 insertions(+), 86 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index a1f91dd425ef..40b68709dbb1 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -20428,6 +20428,10 @@ aarch64_override_options (void)
   if (TARGET_ILP32)
     warning (OPT_Wdeprecated, "%<-mabi=ilp32%> is deprecated");
 
+  if (TARGET_TME)
+    warning (OPT_Wdeprecated,
+	     "the architecture extension %<+tme%> is deprecated");
+
   if (global_options.x_pcrelative_literal_loads == 1)
     warning (OPT_Wdeprecated, "%<-mpc-relative-literal-loads%> is deprecated");
 
@@ -21078,6 +21082,11 @@ aarch64_process_target_attr (tree args)
   while (token)
     {
       num_attrs++;
+
+      if (strcmp (token, "+tme") == 0 && !TARGET_TME)
+	warning (OPT_Wdeprecated,
+		 "the architecture extension %<+tme%> is deprecated");
+
       if (!aarch64_process_one_target_attr (token))
 	{
 	  /* Check if token is possibly an arch extension without
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2e5c9d6788ed..739fc77c282b 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -21991,8 +21991,6 @@ Enable SVE2 sha3 instructions.  This also enables SVE2 instructions.
 Enable SVE2.1 instructions.  This also enables SVE2 instructions.
 @item sve2p2
 Enable SVE2.2 instructions.  This also enables SVE2 and SVE2.1 instructions.
-@item tme
-Enable the Transactional Memory Extension.
 @item i8mm
 Enable 8-bit Integer Matrix Multiply instructions.  This also enables
 Advanced SIMD and floating-point instructions.  This option is enabled by
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme.c b/gcc/testsuite/gcc.target/aarch64/acle/tme.c
deleted file mode 100644
index 5df93b1dcb10..000000000000
--- a/gcc/testsuite/gcc.target/aarch64/acle/tme.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Test the TME intrinsics.  */
-
-/* { dg-do compile } */
-/* { dg-options "-save-temps -O2 -march=armv8-a+tme" } */
-
-#include "arm_acle.h"
-
-#define tcancel_reason 0x234
-
-unsigned
-check_tme (void)
-{
-  unsigned status = __tstart ();
-  if (status == 0)
-    {
-      if (__ttest () == 2)
-	{
-	  __tcancel (tcancel_reason & _TMFAILURE_REASON);
-	  return tcancel_reason;
-	}
-
-      __tcommit ();
-      return 0;
-    }
-  else if (status & _TMFAILURE_NEST)
-    return _TMFAILURE_NEST;
-  else if (status & _TMFAILURE_TRIVIAL)
-    return _TMFAILURE_TRIVIAL;
-}
-
-/* { dg-final { scan-assembler "tstart\tx..?\n" } } */
-/* { dg-final { scan-assembler "tcancel\t#564\n" } } */
-/* { dg-final { scan-assembler "ttest\tx..?\n" } } */
-/* { dg-final { scan-assembler "tcommit\n" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c
deleted file mode 100644
index 9894d3341f6b..000000000000
--- a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* { dg-do compile } */
-/* { dg-additional-options "-march=armv8-a" } */
-
-#include <arm_acle.h>
-
-void foo (void)
-{
-  __tcommit (); /* { dg-error {ACLE function '__tcommit' requires ISA extension 'tme'} } */
-}
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c
deleted file mode 100644
index 4e3d69712b14..000000000000
--- a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do compile } */
-/* { dg-additional-options "-march=armv8-a" } */
-
-#include <arm_acle.h>
-
-#pragma GCC target("arch=armv8-a+tme")
-void foo (void)
-{
-  __tcommit ();
-}
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c
deleted file mode 100644
index 5f480ebb8209..000000000000
--- a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c
+++ /dev/null
@@ -1,9 +0,0 @@
-/* { dg-do compile } */
-/* { dg-additional-options "-march=armv8-a+tme -mgeneral-regs-only" } */
-
-#include <arm_acle.h>
-
-void foo (void)
-{
-  __tcommit ();
-}
diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c
deleted file mode 100644
index bf4d368370c6..000000000000
--- a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/* { dg-do compile } */
-/* { dg-additional-options "-march=armv8-a+tme" } */
-
-#include <arm_acle.h>
-
-#pragma GCC target("arch=armv8-a")
-void foo (void)
-{
-  __tcommit (); /* { dg-error {ACLE function '__tcommit' requires ISA extension 'tme'} } */
-}
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
index d8fc86d15578..76fc5b5680e2 100644
--- a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_2.c
@@ -4,18 +4,6 @@
 #pragma GCC push_options
 #pragma GCC target ("arch=armv8-a")
 
-#pragma GCC push_options
-#pragma GCC target ("arch=armv8-a+tme")
-#ifndef __ARM_FEATURE_TME
-#error "__ARM_FEATURE_TME is not defined but should be!"
-#endif
-
-#pragma GCC pop_options
-
-#ifdef __ARM_FEATURE_TME
-#error "__ARM_FEATURE_TME is defined but should not be!"
-#endif
-
 /* Test Armv8.6-A features.  */
 
 #ifdef __ARM_FEATURE_MATMUL_INT8
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.