arm: [testsuite] Skip thumb2-cond-cmp tests on Cortex-M [PR94595]
authorChristophe Lyon <christophe.lyon@linaro.org>
Mon, 7 Sep 2020 14:53:38 +0000 (14:53 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Wed, 30 Sep 2020 14:55:45 +0000 (14:55 +0000)
Since r204778 (g571880a0a4c512195aa7d41929ba6795190887b2), we favor
branches over IT blocks on Cortex-M. As a result, instead of
generating two nested IT blocks in thumb2-cond-cmp-[1234].c, we
generate either a single IT block, or use branches depending on
conditions tested by the program.

Since this was a deliberate change and the tests still pass as
expected on Cortex-A, this patch skips them when targetting
Cortex-M. The avoids the failures on Cortex M3, M4, and M33.  This
patch makes the testcases unsupported on Cortex-M7 although they pass
in this case because this CPU has different branch costs.

I tried to relax the scan-assembler directives using eg. cmpne|subne
or cmpgt|ble but that seemed fragile.

2020-09-07  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/testsuite/
PR target/94595
* gcc.target/arm/thumb2-cond-cmp-1.c: Skip if arm_cortex_m.
* gcc.target/arm/thumb2-cond-cmp-2.c: Skip if arm_cortex_m.
* gcc.target/arm/thumb2-cond-cmp-3.c: Skip if arm_cortex_m.
* gcc.target/arm/thumb2-cond-cmp-4.c: Skip if arm_cortex_m.

gcc/testsuite/gcc.target/arm/thumb2-cond-cmp-1.c
gcc/testsuite/gcc.target/arm/thumb2-cond-cmp-2.c
gcc/testsuite/gcc.target/arm/thumb2-cond-cmp-3.c
gcc/testsuite/gcc.target/arm/thumb2-cond-cmp-4.c

index 45ab605e72ea725b2da4bf7c74e81b3690f6bc7c..36204f4bf513182db26f2cedc142752a59ffb812 100644 (file)
@@ -1,6 +1,6 @@
 /* Use conditional compare */
 /* { dg-options "-O2" } */
-/* { dg-skip-if "" { arm_thumb1_ok } } */
+/* { dg-skip-if "" { arm_thumb1_ok || arm_cortex_m } } */
 /* { dg-final { scan-assembler "cmpne" } } */
 
 int f(int i, int j) 
index 17d9a8f76d6bc4db228bb1e7074fc829aa98aa90..108d1c3ed699e6c034594ebb3a8b83c00b5a34dd 100644 (file)
@@ -1,6 +1,6 @@
 /* Use conditional compare */                                                                                         
 /* { dg-options "-O2" } */
-/* { dg-skip-if "" { arm_thumb1_ok } } */
+/* { dg-skip-if "" { arm_thumb1_ok || arm_cortex_m } } */
 /* { dg-final { scan-assembler "cmpeq" } } */
 
 int f(int i, int j) 
index 6b2a79b1a9efa3675b2e81958151b9dcd9db36d4..ca7fd9f928f5dd33a3d756c18999db43cf0fc564 100644 (file)
@@ -1,6 +1,6 @@
 /* Use conditional compare */                                                                                         
 /* { dg-options "-O2" } */
-/* { dg-skip-if "" { arm_thumb1_ok } } */
+/* { dg-skip-if "" { arm_thumb1_ok || arm_cortex_m } } */
 /* { dg-final { scan-assembler "cmpgt" } } */
 
 int f(int i, int j)
index 80e1076fd13d8390d2297fec4324c08d44afe5a8..91cc8f408effc1dca78a753c2088ebe017c66539 100644 (file)
@@ -1,6 +1,6 @@
 /* Use conditional compare */                                                                                         
 /* { dg-options "-O2" } */
-/* { dg-skip-if "" { arm_thumb1_ok } } */
+/* { dg-skip-if "" { arm_thumb1_ok || arm_cortex_m } } */
 /* { dg-final { scan-assembler "cmpgt" } } */
 
 int f(int i, int j)