[v2,1/1] aarch64: deprecate the TME extension
Checks
Commit Message
From: Richard Earnshaw <rearnsha@arm.com>
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.
---
gcc/config/aarch64/aarch64.cc | 10 +++++-
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(+), 87 deletions(-)
delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme.c
delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c
delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c
delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c
delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c
Comments
On Fri, Jul 17, 2026 at 12:26:08PM +0000, Richard Earnshaw via Sourceware Forge wrote:
> From: Richard Earnshaw <rearnsha@arm.com>
>
> 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.
> ---
> gcc/config/aarch64/aarch64.cc | 10 +++++-
> 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(+), 87 deletions(-)
> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme.c
> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c
> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c
> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c
> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c
>
> diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
> index a1f91dd425ef..2d34ee09b5be 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");
> +
This check misses stuff like "+memtag+tme", and I think it's also in the wrong
place. The ideal place to check would probably be in aarch64_parse_extension;
if its use in the driver makes that difficult, then we should find some way of
passing the information out of that function to somewhere that can emit the
warning.
We could also use a global variable to ensure we only warn once about each
deprecated feature - if there's multiple instances, users can easily search the
code for "+tme" to find all of them.
Alice
> if (!aarch64_process_one_target_attr (token))
> {
> /* Check if token is possibly an arch extension without
> @@ -21094,7 +21103,6 @@ aarch64_process_target_attr (tree args)
> error ("pragma or attribute %<target(\"%s\")%> is not valid", token);
> return false;
> }
> -
> token = strtok_r (NULL, ",", &str_to_check);
> }
>
On 17/07/2026 15:32, Alice Carlotti wrote:
> On Fri, Jul 17, 2026 at 12:26:08PM +0000, Richard Earnshaw via Sourceware Forge wrote:
> > From: Richard Earnshaw <rearnsha@arm.com>
> >
> > 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.
> > ---
> > gcc/config/aarch64/aarch64.cc | 10 +++++-
> > 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(+), 87 deletions(-)
> > delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme.c
> > delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c
> > delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c
> > delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c
> > delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c
> >
> > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
> > index a1f91dd425ef..2d34ee09b5be 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");
> > +
>
> This check misses stuff like "+memtag+tme", and I think it's also in the wrong
> place. The ideal place to check would probably be in aarch64_parse_extension;
> if its use in the driver makes that difficult, then we should find some way of
> passing the information out of that function to somewhere that can emit the
> warning.
Good catch, I forgot you can (of course) have multiple extensions
separated by + here. Thanks for spotting that.
>
> We could also use a global variable to ensure we only warn once about each
> deprecated feature - if there's multiple instances, users can easily search the
> code for "+tme" to find all of them.
While I agree that we definitely don't want multiple diagnostics at the
same location, I believe it is conventional for diagnostics to warn
about all instances of a problem, so that users can fix them in bulk
without having to go through an edit-compile cycle for every fix.
Alex
>
> Alice
>
> > if (!aarch64_process_one_target_attr (token))
> > {
> > /* Check if token is possibly an arch extension without
> > @@ -21094,7 +21103,6 @@ aarch64_process_target_attr (tree args)
> > error ("pragma or attribute %<target(\"%s\")%> is not valid", token);
> > return false;
> > }
> > -
> > token = strtok_r (NULL, ",", &str_to_check);
> > }
> >
On 17/07/2026 15:32, Alice Carlotti wrote:
> On Fri, Jul 17, 2026 at 12:26:08PM +0000, Richard Earnshaw via Sourceware Forge wrote:
>> From: Richard Earnshaw <rearnsha@arm.com>
>>
>> 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.
>> ---
>> gcc/config/aarch64/aarch64.cc | 10 +++++-
>> 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(+), 87 deletions(-)
>> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme.c
>> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c
>> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c
>> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c
>> delete mode 100644 gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c
>>
>> diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
>> index a1f91dd425ef..2d34ee09b5be 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");
>> +
>
> This check misses stuff like "+memtag+tme", and I think it's also in the wrong
> place.
Bah, just after I pushed the patch. I thought I'd handled this by looking at token inside the loop, but that's for comma separated strings. Fix coming soon.
> The ideal place to check would probably be in aarch64_parse_extension;> if its use in the driver makes that difficult, then we should find some way of
> passing the information out of that function to somewhere that can emit the
> warning.
I'm not sure it's worth all the reworking that would entail just for a deprecation warning that will go away as soon as we remove this feature.
>
> We could also use a global variable to ensure we only warn once about each
> deprecated feature - if there's multiple instances, users can easily search the
> code for "+tme" to find all of them.
>
That wouldn't work if the compiler is invoked as a JIT server. It's also useful to get all (well most of, in this case) the warnings in a single run of the compiler rather than have to resort to other techniques to find them.
R.
> Alice
>
>> if (!aarch64_process_one_target_attr (token))
>> {
>> /* Check if token is possibly an arch extension without
>> @@ -21094,7 +21103,6 @@ aarch64_process_target_attr (tree args)
>> error ("pragma or attribute %<target(\"%s\")%> is not valid", token);
>> return false;
>> }
>> -
>> token = strtok_r (NULL, ",", &str_to_check);
>> }
>>
@@ -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
@@ -21094,7 +21103,6 @@ aarch64_process_target_attr (tree args)
error ("pragma or attribute %<target(\"%s\")%> is not valid", token);
return false;
}
-
token = strtok_r (NULL, ",", &str_to_check);
}
@@ -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
deleted file mode 100644
@@ -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" } } */
deleted file mode 100644
@@ -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'} } */
-}
deleted file mode 100644
@@ -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 ();
-}
deleted file mode 100644
@@ -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 ();
-}
deleted file mode 100644
@@ -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'} } */
-}
@@ -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