[PR96375] arm: Fix testcase selection for Low Overhead Loop tests

Message ID gkrmu3ao5ad.fsf@arm.com
State New
Headers show
Series
  • [PR96375] arm: Fix testcase selection for Low Overhead Loop tests
Related show

Commit Message

Andrea Corallo Aug. 4, 2020, 2:27 p.m.
Hi all,

I'd like to submit the following patch to fix PR96375 ([11 regression]
arm/lob[2-5].c fail on some configurations).

It fix the observed regression making sure -mthumb is always used and
allowing Low Overhead Loop tests to be executed only on cortex-M profile
targets.

Does not introduce regressions in my testing and fix the reported one
according to Christophe (in Cc).

Okay for trunk?

Thanks

  Andrea

2020-07-31  Andrea Corallo  <andrea.corallo@arm.com>

	* gcc.target/arm/lob1.c: Fix missing flag.
	* gcc.target/arm/lob2.c: Likewise.
	* gcc.target/arm/lob3.c: Likewise.
	* gcc.target/arm/lob4.c: Likewise.
	* gcc.target/arm/lob5.c: Likewise.
	* gcc.target/arm/lob6.c: Likewise.
	* lib/target-supports.exp
	(check_effective_target_arm_v8_1_lob_ok): Return 1 only for
	cortex-m targets, add '-mthumb' flag.
From c4e7c1193a736c1e25dd0646c00310bc8dc833df Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>

Date: Fri, 31 Jul 2020 14:52:24 +0100
Subject: [PATCH] arm: Fix testcase selection for Low Overhead Loop tests
 [PR96375]

gcc/testsuite/ChangeLog

2020-07-31  Andrea Corallo  <andrea.corallo@arm.com>

	* gcc.target/arm/lob1.c: Fix missing flag.
	* gcc.target/arm/lob2.c: Likewise.
	* gcc.target/arm/lob3.c: Likewise.
	* gcc.target/arm/lob4.c: Likewise.
	* gcc.target/arm/lob5.c: Likewise.
	* gcc.target/arm/lob6.c: Likewise.
	* lib/target-supports.exp
	(check_effective_target_arm_v8_1_lob_ok): Return 1 only for
	cortex-m targets, add '-mthumb' flag.
---
 gcc/testsuite/gcc.target/arm/lob1.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob2.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob3.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob4.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob5.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob6.c   | 2 +-
 gcc/testsuite/lib/target-supports.exp | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.17.1

Comments

Jonathan Wakely via Gcc-patches Oct. 1, 2020, 2:35 p.m. | #1
Andrea Corallo <andrea.corallo@arm.com> writes:

> Hi all,

>

> I'd like to submit the following patch to fix PR96375 ([11 regression]

> arm/lob[2-5].c fail on some configurations).

>

> It fix the observed regression making sure -mthumb is always used and

> allowing Low Overhead Loop tests to be executed only on cortex-M profile

> targets.

>

> Does not introduce regressions in my testing and fix the reported one

> according to Christophe (in Cc).

>

> Okay for trunk?

>

> Thanks

>

>   Andrea

>

> 2020-07-31  Andrea Corallo  <andrea.corallo@arm.com>

>

> 	* gcc.target/arm/lob1.c: Fix missing flag.

> 	* gcc.target/arm/lob2.c: Likewise.

> 	* gcc.target/arm/lob3.c: Likewise.

> 	* gcc.target/arm/lob4.c: Likewise.

> 	* gcc.target/arm/lob5.c: Likewise.

> 	* gcc.target/arm/lob6.c: Likewise.

> 	* lib/target-supports.exp

> 	(check_effective_target_arm_v8_1_lob_ok): Return 1 only for

> 	cortex-m targets, add '-mthumb' flag.


I really forgot to ping this patch (I'm reattaching it for convenience).

It still applies cleanly so... ping :)
From 7056cfbde6ccf43eaf8651af2b4a09a31c9276de Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>

Date: Fri, 31 Jul 2020 14:52:24 +0100
Subject: [PATCH] arm: Fix testcase selection for Low Overhead Loop tests
 [PR96375]

gcc/testsuite/ChangeLog

2020-07-31  Andrea Corallo  <andrea.corallo@arm.com>

	* gcc.target/arm/lob1.c: Fix missing flag.
	* gcc.target/arm/lob2.c: Likewise.
	* gcc.target/arm/lob3.c: Likewise.
	* gcc.target/arm/lob4.c: Likewise.
	* gcc.target/arm/lob5.c: Likewise.
	* gcc.target/arm/lob6.c: Likewise.
	* lib/target-supports.exp
	(check_effective_target_arm_v8_1_lob_ok): Return 1 only for
	cortex-m targets, add '-mthumb' flag.
---
 gcc/testsuite/gcc.target/arm/lob1.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob2.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob3.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob4.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob5.c   | 2 +-
 gcc/testsuite/gcc.target/arm/lob6.c   | 2 +-
 gcc/testsuite/lib/target-supports.exp | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/lob1.c b/gcc/testsuite/gcc.target/arm/lob1.c
index b92dc551d50..ba5c82cd55c 100644
--- a/gcc/testsuite/gcc.target/arm/lob1.c
+++ b/gcc/testsuite/gcc.target/arm/lob1.c
@@ -3,7 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target arm_v8_1_lob_ok } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/lob2.c b/gcc/testsuite/gcc.target/arm/lob2.c
index 1fe9a9d82bb..fdeb2686f51 100644
--- a/gcc/testsuite/gcc.target/arm/lob2.c
+++ b/gcc/testsuite/gcc.target/arm/lob2.c
@@ -2,7 +2,7 @@
    if a non-inlineable function call takes place inside the loop.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/lob3.c b/gcc/testsuite/gcc.target/arm/lob3.c
index 17cba007ccb..70314ea84b3 100644
--- a/gcc/testsuite/gcc.target/arm/lob3.c
+++ b/gcc/testsuite/gcc.target/arm/lob3.c
@@ -2,7 +2,7 @@
    if causes VFP emulation library calls to happen inside the loop.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps -mfloat-abi=soft" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps -mfloat-abi=soft" } */
 /* { dg-require-effective-target arm_softfloat } */
 #include <stdlib.h>
 #include "lob.h"
diff --git a/gcc/testsuite/gcc.target/arm/lob4.c b/gcc/testsuite/gcc.target/arm/lob4.c
index 444a2c7b4bf..792f352d682 100644
--- a/gcc/testsuite/gcc.target/arm/lob4.c
+++ b/gcc/testsuite/gcc.target/arm/lob4.c
@@ -2,7 +2,7 @@
    if LR is modified within the loop.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps -mfloat-abi=soft" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps -mfloat-abi=soft" } */
 /* { dg-require-effective-target arm_softfloat } */
 #include <stdlib.h>
 #include "lob.h"
diff --git a/gcc/testsuite/gcc.target/arm/lob5.c b/gcc/testsuite/gcc.target/arm/lob5.c
index c4f46e41532..1a6adf1e28e 100644
--- a/gcc/testsuite/gcc.target/arm/lob5.c
+++ b/gcc/testsuite/gcc.target/arm/lob5.c
@@ -3,7 +3,7 @@
    therefore is not optimizable.  Outer loops are not optimized.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/lob6.c b/gcc/testsuite/gcc.target/arm/lob6.c
index 56126769460..17b6124295e 100644
--- a/gcc/testsuite/gcc.target/arm/lob6.c
+++ b/gcc/testsuite/gcc.target/arm/lob6.c
@@ -3,7 +3,7 @@
 /* { dg-do run } */
 /* { dg-require-effective-target arm_v8_1_lob_ok } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 0a00972edb5..3f4073be223 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -10347,7 +10347,7 @@ proc check_effective_target_arm_v8_3a_bkey_directive { } {
 # Overhead Loop, 0 otherwise.  The test is valid for ARM.
 
 proc check_effective_target_arm_v8_1_lob_ok { } {
-    if { ![istarget arm*-*-*] } {
+    if { ![check_effective_target_arm_cortex_m] } {
         return 0;
     } else {
 	return [check_runtime arm_v8_1_lob_hw_available {
@@ -10361,7 +10361,7 @@ proc check_effective_target_arm_v8_1_lob_ok { } {
 		  asm goto ("le lr, %l0" : : : "lr" : loop);
 		  return i != 10;
 		}
-	} "-march=armv8.1-m.main" ]
+	} "-march=armv8.1-m.main -mthumb" ]
     }
 }
 
-- 
2.17.1
Jonathan Wakely via Gcc-patches Oct. 1, 2020, 2:45 p.m. | #2
> -----Original Message-----

> From: Andrea Corallo <Andrea.Corallo@arm.com>

> Sent: 01 October 2020 15:36

> To: gcc-patches@gcc.gnu.org

> Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>; Kyrylo Tkachov

> <Kyrylo.Tkachov@arm.com>; Christophe Lyon <christophe.lyon@linaro.org>

> Subject: Re: [PATCH PR96375] arm: Fix testcase selection for Low Overhead

> Loop tests

> 

> Andrea Corallo <andrea.corallo@arm.com> writes:

> 

> > Hi all,

> >

> > I'd like to submit the following patch to fix PR96375 ([11 regression]

> > arm/lob[2-5].c fail on some configurations).

> >

> > It fix the observed regression making sure -mthumb is always used and

> > allowing Low Overhead Loop tests to be executed only on cortex-M profile

> > targets.

> >

> > Does not introduce regressions in my testing and fix the reported one

> > according to Christophe (in Cc).

> >

> > Okay for trunk?


Ok.
Thanks,
Kyrill

> >

> > Thanks

> >

> >   Andrea

> >

> > 2020-07-31  Andrea Corallo  <andrea.corallo@arm.com>

> >

> > 	* gcc.target/arm/lob1.c: Fix missing flag.

> > 	* gcc.target/arm/lob2.c: Likewise.

> > 	* gcc.target/arm/lob3.c: Likewise.

> > 	* gcc.target/arm/lob4.c: Likewise.

> > 	* gcc.target/arm/lob5.c: Likewise.

> > 	* gcc.target/arm/lob6.c: Likewise.

> > 	* lib/target-supports.exp

> > 	(check_effective_target_arm_v8_1_lob_ok): Return 1 only for

> > 	cortex-m targets, add '-mthumb' flag.

> 

> I really forgot to ping this patch (I'm reattaching it for convenience).

> 

> It still applies cleanly so... ping :)
Jonathan Wakely via Gcc-patches Oct. 1, 2020, 3:35 p.m. | #3
Kyrylo Tkachov <Kyrylo.Tkachov@arm.com> writes:

>> -----Original Message-----

>> From: Andrea Corallo <Andrea.Corallo@arm.com>

>> Sent: 01 October 2020 15:36

>> To: gcc-patches@gcc.gnu.org

>> Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>; Kyrylo Tkachov

>> <Kyrylo.Tkachov@arm.com>; Christophe Lyon <christophe.lyon@linaro.org>

>> Subject: Re: [PATCH PR96375] arm: Fix testcase selection for Low Overhead

>> Loop tests

>> 

>> Andrea Corallo <andrea.corallo@arm.com> writes:

>> 

>> > Hi all,

>> >

>> > I'd like to submit the following patch to fix PR96375 ([11 regression]

>> > arm/lob[2-5].c fail on some configurations).

>> >

>> > It fix the observed regression making sure -mthumb is always used and

>> > allowing Low Overhead Loop tests to be executed only on cortex-M profile

>> > targets.

>> >

>> > Does not introduce regressions in my testing and fix the reported one

>> > according to Christophe (in Cc).

>> >

>> > Okay for trunk?

>

> Ok.

> Thanks,

> Kyrill


Hi Kyrill,

Installed as 968ec08efef.

Thanks!

  Andrea

Patch

diff --git a/gcc/testsuite/gcc.target/arm/lob1.c b/gcc/testsuite/gcc.target/arm/lob1.c
index b92dc551d50..ba5c82cd55c 100644
--- a/gcc/testsuite/gcc.target/arm/lob1.c
+++ b/gcc/testsuite/gcc.target/arm/lob1.c
@@ -3,7 +3,7 @@ 
 /* { dg-do run } */
 /* { dg-require-effective-target arm_v8_1_lob_ok } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/lob2.c b/gcc/testsuite/gcc.target/arm/lob2.c
index 1fe9a9d82bb..fdeb2686f51 100644
--- a/gcc/testsuite/gcc.target/arm/lob2.c
+++ b/gcc/testsuite/gcc.target/arm/lob2.c
@@ -2,7 +2,7 @@ 
    if a non-inlineable function call takes place inside the loop.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/lob3.c b/gcc/testsuite/gcc.target/arm/lob3.c
index 17cba007ccb..70314ea84b3 100644
--- a/gcc/testsuite/gcc.target/arm/lob3.c
+++ b/gcc/testsuite/gcc.target/arm/lob3.c
@@ -2,7 +2,7 @@ 
    if causes VFP emulation library calls to happen inside the loop.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps -mfloat-abi=soft" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps -mfloat-abi=soft" } */
 /* { dg-require-effective-target arm_softfloat } */
 #include <stdlib.h>
 #include "lob.h"
diff --git a/gcc/testsuite/gcc.target/arm/lob4.c b/gcc/testsuite/gcc.target/arm/lob4.c
index 444a2c7b4bf..792f352d682 100644
--- a/gcc/testsuite/gcc.target/arm/lob4.c
+++ b/gcc/testsuite/gcc.target/arm/lob4.c
@@ -2,7 +2,7 @@ 
    if LR is modified within the loop.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps -mfloat-abi=soft" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps -mfloat-abi=soft" } */
 /* { dg-require-effective-target arm_softfloat } */
 #include <stdlib.h>
 #include "lob.h"
diff --git a/gcc/testsuite/gcc.target/arm/lob5.c b/gcc/testsuite/gcc.target/arm/lob5.c
index c4f46e41532..1a6adf1e28e 100644
--- a/gcc/testsuite/gcc.target/arm/lob5.c
+++ b/gcc/testsuite/gcc.target/arm/lob5.c
@@ -3,7 +3,7 @@ 
    therefore is not optimizable.  Outer loops are not optimized.  */
 /* { dg-do compile } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/gcc.target/arm/lob6.c b/gcc/testsuite/gcc.target/arm/lob6.c
index 56126769460..17b6124295e 100644
--- a/gcc/testsuite/gcc.target/arm/lob6.c
+++ b/gcc/testsuite/gcc.target/arm/lob6.c
@@ -3,7 +3,7 @@ 
 /* { dg-do run } */
 /* { dg-require-effective-target arm_v8_1_lob_ok } */
 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" "-mcpu=*" } } */
-/* { dg-options "-march=armv8.1-m.main -O3 --save-temps" } */
+/* { dg-options "-march=armv8.1-m.main -mthumb -O3 --save-temps" } */
 #include <stdlib.h>
 #include "lob.h"
 
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 57eed3012b9..99ef55cbbe2 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -10283,7 +10283,7 @@  proc check_effective_target_arm_v8_3a_bkey_directive { } {
 # Overhead Loop, 0 otherwise.  The test is valid for ARM.
 
 proc check_effective_target_arm_v8_1_lob_ok { } {
-    if { ![istarget arm*-*-*] } {
+    if { ![check_effective_target_arm_cortex_m] } {
         return 0;
     } else {
 	return [check_runtime arm_v8_1_lob_hw_available {
@@ -10297,7 +10297,7 @@  proc check_effective_target_arm_v8_1_lob_ok { } {
 		  asm goto ("le lr, %l0" : : : "lr" : loop);
 		  return i != 10;
 		}
-	} "-march=armv8.1-m.main" ]
+	} "-march=armv8.1-m.main -mthumb" ]
     }
 }