From 968ec08efefeea6fbc0cdc379e98ce3e28904083 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Thu, 1 Oct 2020 17:16:00 +0200 Subject: [PATCH] arm: Fix testcase selection for Low Overhead Loop tests [PR96375] gcc/testsuite/ PR target/96375 * 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 #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 #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 #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 #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 #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 #include "lob.h" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2fb59e8759a..38af6784de8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -10380,7 +10380,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 { @@ -10394,7 +10394,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.30.2