* tc_mips.c (md_begin): Warn about incompatibility between -march=FOO
authorThiemo Seufer <ths@networkno.de>
Tue, 21 Aug 2001 01:13:05 +0000 (01:13 +0000)
committerThiemo Seufer <ths@networkno.de>
Tue, 21 Aug 2001 01:13:05 +0000 (01:13 +0000)
and -mipsN option, continue with default ISA.

gas/ChangeLog
gas/config/tc-mips.c

index 526d5dff36a1da8a364d2df76b75c3bb6ef548cf..ed71bd43c3632a2a7ca341ed852f7453388569e3 100644 (file)
@@ -1,3 +1,8 @@
+2001-08-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * tc_mips.c (md_begin): Warn about incompatibility between -march=FOO
+       and -mipsN option, continue with default ISA.
+
 2001-08-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 
        * config/tc-mips.c (md_parse_option): #ifdef the
 2001-08-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 
        * config/tc-mips.c (md_parse_option): #ifdef the
index b666ed95d3563455042977dd0be29c622f5ea8c8..6cd1f8359a2ad04e6dd381789edc4e4e8ecddae2 100644 (file)
@@ -1010,7 +1010,23 @@ md_begin ()
      the command line, or will be set otherwise if one was.  */
   if (mips_arch != CPU_UNKNOWN && mips_opts.isa != ISA_UNKNOWN)
     {
      the command line, or will be set otherwise if one was.  */
   if (mips_arch != CPU_UNKNOWN && mips_opts.isa != ISA_UNKNOWN)
     {
-      /* We have it all.  There's nothing to do.  */
+      /* We have to check if the isa is the default isa of arch.  Otherwise
+         we'll get invalid object file headers.  */
+      ci = mips_cpu_info_from_cpu (mips_arch);
+      assert (ci != NULL);
+      if (mips_opts.isa != ci->isa)
+       {
+         /* 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;
+       }
     }
   else if (mips_arch != CPU_UNKNOWN && mips_opts.isa == ISA_UNKNOWN)
     {
     }
   else if (mips_arch != CPU_UNKNOWN && mips_opts.isa == ISA_UNKNOWN)
     {