From: Torbjörn SVENSSON <[email protected]>

Override any DejaGNU-provided  -mtune  so the tests generate the expected 
assembly.

gcc/testsuite/ChangeLog:

        * lib/target-supports.exp
        (check_effective_target_arm_v8_1m_mve_fp_ok_nocache): Add
        -mtune=cortex-m55 to ensure the expected assembly is generated.

Signed-off-by: Torbjörn SVENSSON <[email protected]>
---
When running DejaGNU with thumb/arch=a/tune=b and a does not happen to be 
armv8.1-m.main+mve.fp, the effective target check will switch target to that. 
If that happens, the tune "b" will survive and impact what assembler that will 
be generated.
This change resets the tune to the default one for armv8.1-m.main+mve.fp.

Tested on arm-none-eabi with both -mcpu and -mtune on r17-4804-gf7094fe5ff882f 
without any regressions.

Ok for trunk, releases/gcc-16 and releases/gcc-15?

--



This is a forge pull request published on the gcc-patches mailing list mailing 
list
as requested by Torbjörn Svensson via Sourceware Forge 
<[email protected]>.
Forge discussion: https://forge.sourceware.org/gcc/gcc/pulls/238

Get it locally using:
```
git fetch forge-upstream "+refs/versioned_pull/238/*:refs/versioned_pull/238/*"
git switch -c "pr-238-v1" "refs/versioned_pull/238/1/head"
```
Or, download the patch at: https://forge.sourceware.org/gcc/gcc/pulls/238.diff
Created on: 2026-10-04 05:35:24+00:00
Latest update: 2026-10-04 05:37:56+00:00
Changes: 1 changed files, 5 additions, 1 deletions
Head revision: azoff/gcc ref pr/arm_v8_1m_mve_fp_ok-and-mtune commit 
df300aff14fd9a0cd2f90712bcf1043b74935288 
Base revision: gcc/gcc ref trunk commit 
f7094fe5ff882f0c206d51ebe93f33f0193ce636 r17-4804-gf7094fe5ff882f
Merge base: f7094fe5ff882f0c206d51ebe93f33f0193ce636
Requested Reviewers: 

Changed files:
- M: gcc/testsuite/lib/target-supports.exp

 gcc/testsuite/lib/target-supports.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index ae04b6a8daa10..d2c9726fc2a4e 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7033,7 +7033,11 @@ proc check_effective_target_arm_v8_1m_mve_fp_ok_nocache 
{ } {
 
     # Iterate through sets of options to find the compiler flags that
     # need to be added to the -march option.
-    foreach flags {"" "-mfloat-abi=softfp -mfpu=auto -mcpu=unset 
-march=armv8.1-m.main+mve.fp" "-mfloat-abi=hard -mfpu=auto -mcpu=unset 
-march=armv8.1-m.main+mve.fp"} {
+    foreach flags {
+       ""
+       "-mfloat-abi=softfp -mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve.fp 
-mtune=cortex-m55"
+       "-mfloat-abi=hard -mfpu=auto -mcpu=unset -march=armv8.1-m.main+mve.fp 
-mtune=cortex-m55"
+    } {
        if { [check_no_compiler_messages_nocache \
                  arm_v8_1m_mve_fp_ok object {
            #include <arm_mve.h>
-- 
2.54.0

Reply via email to