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]

Fix mips16e testsuite failures on mips64-elf


The recent mips16e testcases were failing on mips64-elf because the
chosen architecture (mips32r2) was not compatible with the prevailing
ABI (o64).  This patch makes mips.exp treat -march=mips32* like -mgp32.

I deliberately didn't try to make the patch handle every 32-bit
-mips* or -march=* option.  There are just so many of them, and
we might as well just add them on an as-needed basis.

Tested on mips64-elf, committed to mainline.

Richard


	* gcc.target/mips/mips.exp (is_gp32_flag): New procedure.
	(dg-mips-options): Use it.

Index: testsuite/gcc.target/mips/mips.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.target/mips/mips.exp,v
retrieving revision 1.3
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.3 mips.exp
--- testsuite/gcc.target/mips/mips.exp	25 Jun 2005 01:45:20 -0000	1.3
+++ testsuite/gcc.target/mips/mips.exp	10 Jul 2005 09:37:40 -0000
@@ -83,9 +83,19 @@ proc setup_mips_tests {} {
     set mips_forced_float [regexp -- {-m(hard|soft)-float} $compiler_flags]
 }
 
+# Return true if command-line option FLAG forces 32-bit code.
+proc is_gp32_flag {flag} {
+    switch -glob -- $flag {
+	-march=mips32* -
+	-mgp32 { return 1 }
+	default { return 0 }
+    }
+}
+
 # Like dg-options, but treats certain MIPS-specific options specially:
 #
 #    -mgp32
+#    -march=mips32*
 #	Force 32-bit code.  Skip the test if the multilib flags force
 #	a 64-bit ABI.
 #
@@ -125,7 +135,7 @@ proc dg-mips-options {args} {
 
     # First handle the -mgp* options.  Add an architecture option if necessary.
     foreach flag $flags {
-	if {$flag == "-mgp32" && $mips_mips64} {
+	if {[is_gp32_flag $flag] && $mips_mips64} {
 	    if {$mips_forced_abi} {
 		set matches 0
 	    } else {


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