[PATCH,testsuite] MIPS: Downgrade R6 to R5 if tests need branch-likely instructions.

Toma Tabacu Toma.Tabacu@imgtec.com
Thu Nov 3 10:57:00 GMT 2016


Hi,

The gcc.target/mips/wrap-delay.c test was failing on mips-img-* toolchains
because it was using -mbranch-likely with an R6 target, and branch-likely
instructions were removed in R6.

This patch makes the testsuite downgrade to R5 if the -mbranch-likely option
is present and we're targeting R6.

Tested with mips-img-elf and mips-img-linux-gnu.

Regards,
Toma Tabacu

gcc/testsuite/
        * gcc.target/mips/mips.exp: Add check for -mbranch-likely in
            condition for R5 downgrade.

diff --git a/gcc/testsuite/gcc.target/mips/mips.exp b/gcc/testsuite/gcc.target/mips/mips.exp
index 7c24140..382d69c 100644
--- a/gcc/testsuite/gcc.target/mips/mips.exp
+++ b/gcc/testsuite/gcc.target/mips/mips.exp
@@ -1176,7 +1176,8 @@ proc mips-dg-options { args } {
                       || [mips_have_test_option_p options "-mpaired-single"]
                       || [mips_have_test_option_p options "-mnan=legacy"]
                       || [mips_have_test_option_p options "-mabs=legacy"]
-                      || [mips_have_test_option_p options "!HAS_LSA"]) } {
+                      || [mips_have_test_option_p options "!HAS_LSA"]
+                      || [mips_have_test_option_p options "-mbranch-likely"]) } {
            if { $gp_size == 32 } {
                mips_make_test_option options "-mips32r5"
            } else {



More information about the Gcc-patches mailing list