This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Restrict mipsisa64-elf vector tests to compatible multilibs


The vector tests run on mipsisa64-elf with -mpaired-single,
but only the plain -EB and -EL multilibs support that option;
it can't be used for soft-float or 32-bit code.

This patch adds a check_effective_target for testing whether
-mpaired-single is supported.  I've modelled it on the other option
tests like -fopenmp and -freorder.  It didn't seem necessary to add
"mips" to the procedure name; if any other target gets a -mpaired-single
option, the procedure would work equally well for that target too.

Tested on mipsisa64-elf.  The tests are still run for the -EB and -EL
multilibs, but not for the -mips32 or -msoft-float ones.  Applied to trunk.

Richard


gcc/testsuite
	* lib/target-supports.exp (check_effective_target_mpaired_single):
	New function.
	* gcc.dg/vect/vect.exp: Use it to check for compatible mipsisa64-elf
	multilibs.
	* g++.dg/vect/vect.exp: Likewise.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 113871)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -454,6 +454,14 @@ proc check_effective_target_fpic { } {
     return 0
 }
 
+# Return true if the target supports -mpaired-single (as used on MIPS).
+
+proc check_effective_target_mpaired_single { } {
+    return [check_no_compiler_messages mpaired_single object {
+	void foo (void) { }
+    } "-mpaired-single"]
+}
+
 # Return true if iconv is supported on the target. In particular IBM1047.
 
 proc check_iconv_available { test_what } {
Index: gcc/testsuite/gcc.dg/vect/vect.exp
===================================================================
--- gcc/testsuite/gcc.dg/vect/vect.exp	(revision 113871)
+++ gcc/testsuite/gcc.dg/vect/vect.exp	(working copy)
@@ -52,7 +52,8 @@ if [istarget "powerpc*-*-*"] {
 } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
     lappend DEFAULT_VECTCFLAGS "-msse2"
     set dg-do-what-default run
-} elseif [istarget "mipsisa64*-*-*"] {
+} elseif { [istarget "mipsisa64*-*-*"]
+	   && [check_effective_target_mpaired_single] } {
     lappend DEFAULT_VECTCFLAGS "-mpaired-single"
     set dg-do-what-default run
 } elseif [istarget "sparc*-*-*"] {
Index: gcc/testsuite/g++.dg/vect/vect.exp
===================================================================
--- gcc/testsuite/g++.dg/vect/vect.exp	(revision 113871)
+++ gcc/testsuite/g++.dg/vect/vect.exp	(working copy)
@@ -61,7 +61,8 @@ if [istarget "powerpc*-*-*"] {
 } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
     lappend DEFAULT_VECTCFLAGS "-msse2"
     set dg-do-what-default run
-} elseif [istarget "mipsisa64*-*-*"] {
+} elseif { [istarget "mipsisa64*-*-*"]
+	   && [check_effective_target_mpaired_single] } {
     lappend DEFAULT_VECTCFLAGS "-mpaired-single"
     set dg-do-what-default run
 } elseif [istarget "sparc*-*-*"] {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]