This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

RFC: Mips option parsing patch


I have the feeling this may not be popular... Eric, Thiemo, comments
welcome.

I'd like to commit the attached patch, with an additional comment I forgot
to write saying that it should be removed some reasonable time after the
release of GCC 3.1.  This is for compatibility with existing assemblers,
which will give object files for -mcpu=r8000 -mips2 a marked ISA of mips4
without using 64-bit instructions.  From what I have heard and found,
GCC 3.0 still requires -mips2 in order to get the proper behaviour.  You
still get warnings based on -mcpu, but they are harmless and the correcting
patch is small.

With this, and my linker changes last week, I can build a working kernel
using current binutils.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2001-11-26  Daniel Jacobowitz  <drow@mvista.com>

	* config/tc-mips.c (md_begin): Accept -mips2 with -march= to mean
	-mgp32 -mfp32.

Index: tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.96
diff -u -p -r1.96 tc-mips.c
--- tc-mips.c	2001/11/15 21:28:56	1.96
+++ tc-mips.c	2001/11/26 19:17:33
@@ -1076,14 +1076,27 @@ md_begin ()
 	{
 	  /* This really should be an error instead of a warning, but old
 	     compilers only have -mcpu which sets both arch and tune.  For
-	     now, we discard arch and preserve tune.  */
-	  as_warn (_("The -march option is incompatible to -mipsN and "
-		     "therefore ignored."));
-	  if (mips_tune == CPU_UNKNOWN)
-	    mips_tune = mips_arch;
-	  ci = mips_cpu_info_from_isa (mips_opts.isa);
-	  assert (ci != NULL);
-	  mips_arch = ci->cpu;
+	     now, we discard arch and preserve tune.  If the specified ISA
+	     was -mips2, and the CPU's ISA is higher, treat -mips2 as
+	     -mgp32 -mfp32 without warning for backwards compatibility.
+	     Don't change the ISA in this case.  */
+	  if (mips_opts.isa == ISA_MIPS2
+	      && ci->isa != ISA_MIPS1)
+	    {
+	      mips_opts.isa = ci->isa;
+	      file_mips_gp32 = 1;
+	      file_mips_fp32 = 1;
+	    }
+	  else
+	    {
+	      as_warn (_("The -march option is incompatible to -mipsN and "
+			 "therefore ignored."));
+	      if (mips_tune == CPU_UNKNOWN)
+		mips_tune = mips_arch;
+	      ci = mips_cpu_info_from_isa (mips_opts.isa);
+	      assert (ci != NULL);
+	      mips_arch = ci->cpu;
+	    }
 	}
     }
   else if (mips_arch != CPU_UNKNOWN && mips_opts.isa == ISA_UNKNOWN)


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