On Jan 23, 2026, "Richard Earnshaw (foss)" <[email protected]> wrote:
> On 19/01/2026 19:23, Alexandre Oliva wrote:
>> -/* { dg-additional-options "-march=armv7-a -mthumb" { target {
>> arm_arch_v7a_ok && arm_thumb2_ok } } } */
>> +/* { dg-additional-options "-mcpu=unset -march=armv7-a -mthumb" { target {
>> arm_arch_v7a_ok && arm_thumb2_ok } } } */
> This will fail if other options set, or config settings imply,
> -mfloat-abi=hard and -mfpu=auto.
> So we should use -march=armv7-a+fp
Oh, good catch, thanks.
Here's the patch with this fix, currently under retesting.
I'll take your response above as approval with changes.
Reset the cpu selection to the default on tests that set -march
explicitly instead of using dg-add-options. The latter would reset
the cpu selection to avoid interference from TOOL_OPTIONS.
Also add +fp to -march in tests that don't override float-abi and fpu,
so that -mfloat-abi=hard -mfpu=auto in TOOL_OPTIONS won't cause a
failure.
for gcc/testsuite/ChangeLog
* gcc.target/arm/bfloat16_simd_1_2.c: Add -mcpu=unset.
* gcc.target/arm/bfloat16_simd_2_2.c: Likewise.
* gcc.target/arm/bfloat16_simd_3_2.c: Likewise.
* gcc.dg/torture/pr120347.c: Likewise. Add +fp to -march.
---
gcc/testsuite/gcc.dg/torture/pr120347.c | 2 +-
gcc/testsuite/gcc.target/arm/bfloat16_simd_1_2.c | 2 +-
gcc/testsuite/gcc.target/arm/bfloat16_simd_2_2.c | 2 +-
gcc/testsuite/gcc.target/arm/bfloat16_simd_3_2.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/testsuite/gcc.dg/torture/pr120347.c
b/gcc/testsuite/gcc.dg/torture/pr120347.c
index a2d187bbc5c60..375a3ec0bc292 100644
--- a/gcc/testsuite/gcc.dg/torture/pr120347.c
+++ b/gcc/testsuite/gcc.dg/torture/pr120347.c
@@ -1,5 +1,5 @@
/* { dg-do assemble } */
-/* { dg-additional-options "-march=armv7-a -mthumb" { target { arm_arch_v7a_ok
&& arm_thumb2_ok } } } */
+/* { dg-additional-options "-mcpu=unset -march=armv7-a+fp -mthumb" { target {
arm_arch_v7a_ok && arm_thumb2_ok } } } */
void *end;
void **start;
diff --git a/gcc/testsuite/gcc.target/arm/bfloat16_simd_1_2.c
b/gcc/testsuite/gcc.target/arm/bfloat16_simd_1_2.c
index 95eecec2d0973..299bd60086b93 100644
--- a/gcc/testsuite/gcc.target/arm/bfloat16_simd_1_2.c
+++ b/gcc/testsuite/gcc.target/arm/bfloat16_simd_1_2.c
@@ -2,7 +2,7 @@
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
-/* { dg-additional-options "-march=armv8.2-a+bf16 -mfloat-abi=softfp
-mfpu=auto" } */
+/* { dg-additional-options "-mcpu=unset -march=armv8.2-a+bf16
-mfloat-abi=softfp -mfpu=auto" } */
/* { dg-additional-options "-O3 --save-temps -std=gnu90" } */
/* { dg-final { check-function-bodies "**" "" } } */
diff --git a/gcc/testsuite/gcc.target/arm/bfloat16_simd_2_2.c
b/gcc/testsuite/gcc.target/arm/bfloat16_simd_2_2.c
index 175bfa5c22738..9b1ff2780417e 100644
--- a/gcc/testsuite/gcc.target/arm/bfloat16_simd_2_2.c
+++ b/gcc/testsuite/gcc.target/arm/bfloat16_simd_2_2.c
@@ -2,7 +2,7 @@
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
-/* { dg-additional-options "-march=armv8.2-a -mfloat-abi=softfp
-mfpu=neon-fp-armv8" } */
+/* { dg-additional-options "-mcpu=unset -march=armv8.2-a -mfloat-abi=softfp
-mfpu=neon-fp-armv8" } */
/* { dg-additional-options "-O3 --save-temps -std=gnu90" } */
/* { dg-final { check-function-bodies "**" "" } } */
diff --git a/gcc/testsuite/gcc.target/arm/bfloat16_simd_3_2.c
b/gcc/testsuite/gcc.target/arm/bfloat16_simd_3_2.c
index 346253b8a47dc..ec9f4a0d690b4 100644
--- a/gcc/testsuite/gcc.target/arm/bfloat16_simd_3_2.c
+++ b/gcc/testsuite/gcc.target/arm/bfloat16_simd_3_2.c
@@ -2,7 +2,7 @@
/* { dg-require-effective-target arm_softfp_ok } */
/* { dg-require-effective-target arm_v8_neon_ok } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
-/* { dg-additional-options "-march=armv8.2-a -mfloat-abi=softfp
-mfpu=neon-fp-armv8" } */
+/* { dg-additional-options "-mcpu=unset -march=armv8.2-a -mfloat-abi=softfp
-mfpu=neon-fp-armv8" } */
/* { dg-additional-options "-O3 --save-temps -std=gnu90" } */
/* { dg-final { check-function-bodies "**" "" } } */
--
Alexandre Oliva, happy hacker https://blog.lx.oliva.nom.br/
Free Software Activist FSFLA co-founder GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!