public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Patch to silent mips gas
@ 2001-06-06  9:45 H . J . Lu
  2001-06-08 22:26 ` H . J . Lu
  0 siblings, 1 reply; 2+ messages in thread
From: H . J . Lu @ 2001-06-06  9:45 UTC (permalink / raw)
  To: binutils; +Cc: linux-mips

It is very annoying for gas to warn NOPS generated from macros. It
causes many "make check" failures in gcc. Here is a patch.


H.J.
----
2001-06-06  H.J. Lu  <hjl@gnu.org>

	* config/tc-mips.c (warn_nops): New variable. Set to 0 to
	disable warning about all NOPS that the assembler generates.
	(macro): Warn NOPS generated only if warn_nops is not 0.
	(md_shortopts): Add `n'.
	(md_parse_option): Set warn_nops to 1 for `n'.

--- gas/config/tc-mips.c.warn	Tue Jun  5 21:01:37 2001
+++ gas/config/tc-mips.c	Tue Jun  5 21:02:36 2001
@@ -313,6 +313,9 @@ enum mips_pic_level
 
 static enum mips_pic_level mips_pic;
 
+/* Warn about all NOPS that the assembler generates.  */
+static int warn_nops = 0;
+
 /* 1 if we should generate 32 bit offsets from the GP register in
    SVR4_PIC mode.  Currently has no meaning in other modes.  */
 static int mips_big_got;
@@ -3620,12 +3623,16 @@ macro (ip)
 	  /* result is always false */
 	  if (! likely)
 	    {
-	      as_warn (_("Branch %s is always false (nop)"), ip->insn_mo->name);
+	      if (warn_nops)
+		as_warn (_("Branch %s is always false (nop)"),
+			 ip->insn_mo->name);
 	      macro_build ((char *) NULL, &icnt, NULL, "nop", "", 0);
 	    }
 	  else
 	    {
-	      as_warn (_("Branch likely %s is always false"), ip->insn_mo->name);
+	      if (warn_nops)
+		as_warn (_("Branch likely %s is always false"),
+			 ip->insn_mo->name);
 	      macro_build ((char *) NULL, &icnt, &offset_expr, "bnel",
 			   "s,t,p", 0, 0);
 	    }
@@ -8860,7 +8867,7 @@ md_number_to_chars (buf, val, n)
     number_to_chars_littleendian (buf, val, n);
 }
 \f
-CONST char *md_shortopts = "O::g::G:";
+CONST char *md_shortopts = "nO::g::G:";
 
 struct option md_longopts[] =
 {
@@ -8975,6 +8982,10 @@ md_parse_option (c, arg)
 
     case OPTION_EL:
       target_big_endian = 0;
+      break;
+
+    case 'n':
+      warn_nops = 1;
       break;
 
     case 'O':

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch to silent mips gas
  2001-06-06  9:45 Patch to silent mips gas H . J . Lu
@ 2001-06-08 22:26 ` H . J . Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H . J . Lu @ 2001-06-08 22:26 UTC (permalink / raw)
  To: binutils

On Wed, Jun 06, 2001 at 09:45:06AM -0700, H . J . Lu wrote:
> It is very annoying for gas to warn NOPS generated from macros. It
> causes many "make check" failures in gcc. Here is a patch.
> 
> 
> H.J.
> ----
> 2001-06-06  H.J. Lu  <hjl@gnu.org>
> 
> 	* config/tc-mips.c (warn_nops): New variable. Set to 0 to
> 	disable warning about all NOPS that the assembler generates.
> 	(macro): Warn NOPS generated only if warn_nops is not 0.
> 	(md_shortopts): Add `n'.
> 	(md_parse_option): Set warn_nops to 1 for `n'.
> 

I checked in this patch.


H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-08 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-06  9:45 Patch to silent mips gas H . J . Lu
2001-06-08 22:26 ` H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).