diff mbox series

testsuite: Disable test for incompatible Arm targets

Message ID 20240213104408.1925198-1-torbjorn.svensson@foss.st.com
State New
Headers show
Series testsuite: Disable test for incompatible Arm targets | expand

Commit Message

Torbjorn SVENSSON Feb. 13, 2024, 10:44 a.m. UTC
Ok for trunk and releases/gcc-13?

The alternative approach (that is changing the result a bit) is to drop
the special treatment for arm*-*-*. I'm not sure if this is prefered or
just disable the test for incompatible flags for arm*-*-*.

--

The test assumes it's okay to supply -march=armv7-a+simd, but it depends
on what target you are running the tests for.  For example, running the
GCC testsuite for Cortex-M0 produces the follwing entry in the logs:

Testing gcc.dg/pr41574.c
doing compile
Executing on host: arm-none-eabi-gcc .../pr41574.c  -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft   -fdiagnostics-plain-output  -O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine -ffat-lto-objects -S -o pr41574.s    (timeout = 800)
spawn -ignore SIGHUP arm-none-eabi-gcc .../pr41574.c -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft -fdiagnostics-plain-output -O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine -ffat-lto-objects -S -o pr41574.s
pid is 9799 -9799
cc1: warning: switch '-mcpu=cortex-m0' conflicts with switch '-march=armv7-a+simd'
pid is -1
output is cc1: warning: switch '-mcpu=cortex-m0' conflicts with switch '-march=armv7-a+simd'
 status 0
FAIL: gcc.dg/pr41574.c (test for excess errors)
Excess errors:
cc1: warning: switch '-mcpu=cortex-m0' conflicts with switch '-march=armv7-a+simd'
PASS: gcc.dg/pr41574.c scan-rtl-dump-not combine "\\(plus:DF \\(mult:DF"

Patch has been verified on Linux.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr41574.c: Disable test for Arm targets incompatible
	with -march=armv7-a+simd.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/gcc.dg/pr41574.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Richard Earnshaw Feb. 13, 2024, 3:43 p.m. UTC | #1
On 13/02/2024 10:44, Torbjörn SVENSSON wrote:
> Ok for trunk and releases/gcc-13?
> 
> The alternative approach (that is changing the result a bit) is to drop
> the special treatment for arm*-*-*. I'm not sure if this is prefered or
> just disable the test for incompatible flags for arm*-*-*.
> 
> --
> 
> The test assumes it's okay to supply -march=armv7-a+simd, but it depends
> on what target you are running the tests for.  For example, running the
> GCC testsuite for Cortex-M0 produces the follwing entry in the logs:

Running the testsuite with -mcpu= in runtest/site.exp flags will uncover 
a whole host of problems with tests that try to specify an architecture. 
  It's essentially broken/unsupported at present.

I have some ideas for how to fix this properly, but they will have to 
wait for gcc-15 now.  In the mean time, I'd rather we didn't try to 
paper over the problem by putting random changes into the tests right now.

R.

> 
> Testing gcc.dg/pr41574.c
> doing compile
> Executing on host: arm-none-eabi-gcc .../pr41574.c  -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft   -fdiagnostics-plain-output  -O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine -ffat-lto-objects -S -o pr41574.s    (timeout = 800)
> spawn -ignore SIGHUP arm-none-eabi-gcc .../pr41574.c -mthumb -march=armv6s-m -mcpu=cortex-m0 -mfloat-abi=soft -fdiagnostics-plain-output -O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine -ffat-lto-objects -S -o pr41574.s
> pid is 9799 -9799
> cc1: warning: switch '-mcpu=cortex-m0' conflicts with switch '-march=armv7-a+simd'
> pid is -1
> output is cc1: warning: switch '-mcpu=cortex-m0' conflicts with switch '-march=armv7-a+simd'
>   status 0
> FAIL: gcc.dg/pr41574.c (test for excess errors)
> Excess errors:
> cc1: warning: switch '-mcpu=cortex-m0' conflicts with switch '-march=armv7-a+simd'
> PASS: gcc.dg/pr41574.c scan-rtl-dump-not combine "\\(plus:DF \\(mult:DF"
> 
> Patch has been verified on Linux.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/pr41574.c: Disable test for Arm targets incompatible
> 	with -march=armv7-a+simd.
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
> ---
>   gcc/testsuite/gcc.dg/pr41574.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/pr41574.c b/gcc/testsuite/gcc.dg/pr41574.c
> index 062c0044532..f6af0c34273 100644
> --- a/gcc/testsuite/gcc.dg/pr41574.c
> +++ b/gcc/testsuite/gcc.dg/pr41574.c
> @@ -1,6 +1,7 @@
>   /* { dg-do compile } */
> -/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { arm*-*-* } } } */
> -/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { ! arm*-*-* } } } */
> +/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" } */
> +/* { dg-require-effective-target arm_arch_v7a_neon_multilib { target { arm*-*-* } } } */
> +/* { dg-additional-options "-march=armv7-a -mfloat-abi=softfp -mfpu=neon" { target { arm*-*-* } } } */
>   
>   
>   static const double one=1.0;
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/pr41574.c b/gcc/testsuite/gcc.dg/pr41574.c
index 062c0044532..f6af0c34273 100644
--- a/gcc/testsuite/gcc.dg/pr41574.c
+++ b/gcc/testsuite/gcc.dg/pr41574.c
@@ -1,6 +1,7 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { arm*-*-* } } } */
-/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { ! arm*-*-* } } } */
+/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" } */
+/* { dg-require-effective-target arm_arch_v7a_neon_multilib { target { arm*-*-* } } } */
+/* { dg-additional-options "-march=armv7-a -mfloat-abi=softfp -mfpu=neon" { target { arm*-*-* } } } */
 
 
 static const double one=1.0;