This is a summary of discussions relative to the merge request created by
Torbjörn Svensson (azoff) <[email protected]> titled
testsuite: arm: add require effective target for cmse tests
since its creation.
Description: Regtested for arm-none-eabi on top of r17-2833-g32657f29f91871.
Ok for trunk and releases/gcc-16?
--
In order for the tests to pass, -mcpu=unset is needed to avoid conflict
between -march and any previous -mcpu argument.
Only run tests when able to, potentially, switch target to
armv8-m.main+fp and armv8.1-m.main+mve.
I did not use dg-add-options to do the target switching since it might
allow more options for the arch than +fp/+mve, for example +dsp, and
this will cause the
scan-rtl-dump final "call \\(mem:SI \\(reg/f:SI [0-7] r[0-7]"
test to fail.
gcc/testsuite/ChangeLog:
* gcc.target/arm/cmse/cmse-18.c: Require effective target
arm_arch_v8m_main_ok and add -mcpu=unset.
* gcc.target/arm/cmse/cmse-19.c: Require effective target
arm_v8_1m_mve_ok and add -mcpu=unset.
Signed-off-by: Torbjörn SVENSSON <[email protected]>
--
CC: [email protected]
CC: [email protected]
The full and up to date discussion can be found at
https://forge.sourceware.org/gcc/gcc/pulls/212
The merge request has been closed without being merged directly on the forge
repository.
On 2026-08-18 12:00:00+00:00, Richard Earnshaw (rearnsha) <[email protected]>
approved the changes:
OK with suggested changed
> +++ gcc/testsuite/gcc.target/arm/cmse/cmse-19.c
> @@ -1,7 +1,8 @@
> /* { dg-do compile } */
> +/* { dg-require-effective-target arm_v8_1m_mve_ok } */
I think we should add arm_arch_v8_1m_main_mve to target-supports, then use it
here and...
> +++ gcc/testsuite/gcc.target/arm/cmse/cmse-19.c
> @@ -2,3 +3,3 @@
> /* This is a duplicate of cmse-18.c, targetting arm_v8_1m_mve, to make sure
> FPCXT is enabled. */
> -/* { dg-options "-mcmse -fdump-rtl-final -march=armv8.1-m.main+mve" } */
> +/* { dg-options "-mcmse -fdump-rtl-final -mcpu=unset
> -march=armv8.1-m.main+mve" } */
use dg-add-options here.
> +++ gcc/testsuite/gcc.target/arm/cmse/cmse-18.c
> @@ -2,2 +2,3 @@
> +/* { dg-require-effective-target arm_arch_v8m_main_ok } */
> /* Make sure FPCXT is not enabled. */
> -/* { dg-options "-mcmse -fdump-rtl-final -march=armv8-m.main+fp" } */
> +/* { dg-options "-mcmse -fdump-rtl-final -mcpu=unset -march=armv8-m.main+fp"
> } */
This should use `dg-add-options arm_arch_v8m_main` rather than setting it
through dg-options.
> +++ gcc/testsuite/gcc.target/arm/cmse/cmse-18.c
> @@ -2,2 +2,3 @@
> +/* { dg-require-effective-target arm_arch_v8m_main_ok } */
> /* Make sure FPCXT is not enabled. */
> -/* { dg-options "-mcmse -fdump-rtl-final -march=armv8-m.main+fp" } */
> +/* { dg-options "-mcmse -fdump-rtl-final -mcpu=unset -march=armv8-m.main+fp"
> } */
Did you see my comment in the commit message?
```
Only run tests when able to, potentially, switch target to
armv8-m.main+fp and armv8.1-m.main+mve.
I did not use dg-add-options to do the target switching since it might
allow more options for the arch than +fp/+mve, for example +dsp, and
this will cause the
scan-rtl-dump final "call \\(mem:SI \\(reg/f:SI [0-7] r[0-7]"
test to fail.
```
But now that I look at it again, I no longer get the problem that I was had
before.
I'll update with dg-add-options instead. Still a bit surprised that I do not
see the issue anymore...
> +++ gcc/testsuite/gcc.target/arm/cmse/cmse-18.c
> @@ -2,2 +2,3 @@
> +/* { dg-require-effective-target arm_arch_v8m_main_ok } */
> /* Make sure FPCXT is not enabled. */
> -/* { dg-options "-mcmse -fdump-rtl-final -march=armv8-m.main+fp" } */
> +/* { dg-options "-mcmse -fdump-rtl-final -mcpu=unset -march=armv8-m.main+fp"
> } */
The arm_arch... family of rules don't add random stuff to try to make things
work; they add exactly the specified set of flags from the table (plus
-mcpu=unset) and fail if that doesn't compile, or doesn't result in the correct
pre-defines. So I don't think you need to worry about that here.
This is completely unlike rules like arm_neon which tries a whole bunch of
garbage to try to make things work.
On 2026-08-19 16:53:28+00:00, Torbjörn Svensson (azoff) wrote:
Pushed to trunk as r17-3435-gf51ab50afb9542.
Will push to releases/gcc-16 on Friday unless there is a regression report.
On 2026-08-21 14:40:20+00:00, Torbjörn Svensson (azoff) wrote:
Also pushed as r16-9576-ge0983afb0e3ad3.