testsuite, aarch64: Normalise options to aarch64.exp.

Message ID 20231026185734.56102-1-iain@sandoe.co.uk
State Accepted
Headers
Series testsuite, aarch64: Normalise options to aarch64.exp. |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Iain Sandoe Oct. 26, 2023, 6:57 p.m. UTC
  tested on cfarm185 (aarch64-linux-gnu, xgene1) and with the aarch64
Darwin prototype.  It is possible that some initial fallout could occur
on some test setups (where the default has been catered for in some
way) - but that should stabilize.  OK for trunk?
thanks
Iain

--- 8< ---

When the compiler is configured --with-cpu= and that is different from
the baselines assumed, we see excess test fails (primarly in body code
scans which are necessarily sensitive to costs).  To stabilize the
testsuite against such changes, use aarch64-with-arch-dg-options ()
to provide suitable consistent defaults.

e.g. for --with-cpu=xgene1 we see over 100 excess fails which are
removed by this change.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/aarch64.exp: Use aarch64-with-arch-dg-options
	to normaize the options to the tests in aarch64.exp.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/testsuite/gcc.target/aarch64/aarch64.exp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Andrew Pinski Oct. 26, 2023, 7 p.m. UTC | #1
On Thu, Oct 26, 2023 at 11:58 AM Iain Sandoe <iains.gcc@gmail.com> wrote:
>
> tested on cfarm185 (aarch64-linux-gnu, xgene1) and with the aarch64
> Darwin prototype.  It is possible that some initial fallout could occur
> on some test setups (where the default has been catered for in some
> way) - but that should stabilize.  OK for trunk?

This fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93619 I think.

Thanks,
Andrew

> thanks
> Iain
>
> --- 8< ---
>
> When the compiler is configured --with-cpu= and that is different from
> the baselines assumed, we see excess test fails (primarly in body code
> scans which are necessarily sensitive to costs).  To stabilize the
> testsuite against such changes, use aarch64-with-arch-dg-options ()
> to provide suitable consistent defaults.
>
> e.g. for --with-cpu=xgene1 we see over 100 excess fails which are
> removed by this change.
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.target/aarch64/aarch64.exp: Use aarch64-with-arch-dg-options
>         to normaize the options to the tests in aarch64.exp.
>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
>  gcc/testsuite/gcc.target/aarch64/aarch64.exp | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64.exp b/gcc/testsuite/gcc.target/aarch64/aarch64.exp
> index bd306e3b288..7612ea704e5 100644
> --- a/gcc/testsuite/gcc.target/aarch64/aarch64.exp
> +++ b/gcc/testsuite/gcc.target/aarch64/aarch64.exp
> @@ -37,9 +37,10 @@ if ![info exists DEFAULT_CFLAGS] then {
>  # Initialize `dg'.
>  dg-init
>
> -# Main loop.
> -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
> -       "" $DEFAULT_CFLAGS
> -
> +aarch64-with-arch-dg-options "" {
> +    # Main loop.
> +    dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
> +           "" $DEFAULT_CFLAGS
> +}
>  # All done.
>  dg-finish
> --
> 2.39.2 (Apple Git-143)
>
  
Richard Sandiford Oct. 26, 2023, 7:40 p.m. UTC | #2
Iain Sandoe <iains.gcc@gmail.com> writes:
> tested on cfarm185 (aarch64-linux-gnu, xgene1) and with the aarch64
> Darwin prototype.  It is possible that some initial fallout could occur
> on some test setups (where the default has been catered for in some
> way) - but that should stabilize.  OK for trunk?
> thanks
> Iain
>
> --- 8< ---
>
> When the compiler is configured --with-cpu= and that is different from
> the baselines assumed, we see excess test fails (primarly in body code
> scans which are necessarily sensitive to costs).  To stabilize the
> testsuite against such changes, use aarch64-with-arch-dg-options ()
> to provide suitable consistent defaults.
>
> e.g. for --with-cpu=xgene1 we see over 100 excess fails which are
> removed by this change.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.target/aarch64/aarch64.exp: Use aarch64-with-arch-dg-options
> 	to normaize the options to the tests in aarch64.exp.

OK, thanks.  I also tried it on two local set-ups and it passed on both.

Richard

>
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> ---
>  gcc/testsuite/gcc.target/aarch64/aarch64.exp | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64.exp b/gcc/testsuite/gcc.target/aarch64/aarch64.exp
> index bd306e3b288..7612ea704e5 100644
> --- a/gcc/testsuite/gcc.target/aarch64/aarch64.exp
> +++ b/gcc/testsuite/gcc.target/aarch64/aarch64.exp
> @@ -37,9 +37,10 @@ if ![info exists DEFAULT_CFLAGS] then {
>  # Initialize `dg'.
>  dg-init
>  
> -# Main loop.
> -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
> -	"" $DEFAULT_CFLAGS
> -
> +aarch64-with-arch-dg-options "" {
> +    # Main loop.
> +    dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
> +	    "" $DEFAULT_CFLAGS
> +}
>  # All done.
>  dg-finish
  
Iain Sandoe Oct. 27, 2023, 11:33 a.m. UTC | #3
Hi Andrew,

> On 26 Oct 2023, at 20:00, Andrew Pinski <pinskia@gmail.com> wrote:
> 
> On Thu, Oct 26, 2023 at 11:58 AM Iain Sandoe <iains.gcc@gmail.com> wrote:
>> 
>> tested on cfarm185 (aarch64-linux-gnu, xgene1) and with the aarch64
>> Darwin prototype.  It is possible that some initial fallout could occur
>> on some test setups (where the default has been catered for in some
>> way) - but that should stabilize.  OK for trunk?
> 
> This fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93619 I think.

Actually, it does not - the aarch64-with-arch-dg-options () function explicitly
excludes overriding mcpu/march/tune options provided by the test-case so
that you still see:

Excess errors:
cc1: warning: switch '-mcpu=octeontx' conflicts with '-march=armv8.4-a’ switch

Iain
  

Patch

diff --git a/gcc/testsuite/gcc.target/aarch64/aarch64.exp b/gcc/testsuite/gcc.target/aarch64/aarch64.exp
index bd306e3b288..7612ea704e5 100644
--- a/gcc/testsuite/gcc.target/aarch64/aarch64.exp
+++ b/gcc/testsuite/gcc.target/aarch64/aarch64.exp
@@ -37,9 +37,10 @@  if ![info exists DEFAULT_CFLAGS] then {
 # Initialize `dg'.
 dg-init
 
-# Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
-	"" $DEFAULT_CFLAGS
-
+aarch64-with-arch-dg-options "" {
+    # Main loop.
+    dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+	    "" $DEFAULT_CFLAGS
+}
 # All done.
 dg-finish