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 <[email protected]>
>>
>> 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);
>> }
>>