public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* mips warning
@ 2005-02-18  2:17 Alan Modra
  2005-02-18  2:18 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2005-02-18  2:17 UTC (permalink / raw)
  To: binutils

gas/config/tc-mips.c:4171: warning: 'tempreg' may be used uninitialized in this function

The following doesn't set tempreg in the as_bad branch.

    ld:
      /* XXX Why don't we try to use AT for all expansions? */
      if (!mips_opts.noat && (breg == treg || coproc || lr))
	{
	  tempreg = AT;
	  used_at = 1;
	}
      else if (breg == treg
	       && (offset_expr.X_op != O_constant
		   || (offset_expr.X_add_number > 0x7fff
		       || offset_expr.X_add_number < -0x8000)))
	{
	  as_bad(_("load expansion needs $at register"));
	}
      else
	{
	  tempreg = treg;
	  used_at = 0;
	}
      goto ld_st;

My guess is you want

	* config/tc-mips.c (macro <ld>): Always set tempreg.

OK?

Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.283
diff -u -p -r1.283 tc-mips.c
--- gas/config/tc-mips.c	17 Feb 2005 13:46:04 -0000	1.283
+++ gas/config/tc-mips.c	17 Feb 2005 23:58:07 -0000
@@ -5765,15 +5765,14 @@ macro (struct mips_cl_insn *ip)
 	  tempreg = AT;
 	  used_at = 1;
 	}
-      else if (breg == treg
-	       && (offset_expr.X_op != O_constant
-		   || (offset_expr.X_add_number > 0x7fff
-		       || offset_expr.X_add_number < -0x8000)))
-	{
-	  as_bad(_("load expansion needs $at register"));
-	}
       else
 	{
+	  if (breg == treg
+	      && (offset_expr.X_op != O_constant
+		  || (offset_expr.X_add_number > 0x7fff
+		      || offset_expr.X_add_number < -0x8000)))
+	    as_bad(_("load expansion needs $at register"));
+
 	  tempreg = treg;
 	  used_at = 0;
 	}

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: mips warning
  2005-02-18  2:17 mips warning Alan Modra
@ 2005-02-18  2:18 ` Alan Modra
  2005-02-18 21:18   ` Maciej W. Rozycki
  2005-02-20 15:05   ` Thiemo Seufer
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Modra @ 2005-02-18  2:18 UTC (permalink / raw)
  To: binutils

On Fri, Feb 18, 2005 at 10:31:11AM +1030, Alan Modra wrote:
> gas/config/tc-mips.c:4171: warning: 'tempreg' may be used uninitialized in this function
> 	* config/tc-mips.c (macro <ld>): Always set tempreg.

Ug.  The same is needed for st.

	* config/tc-mips.c (macro <ld, st>): Always set tempreg.

Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.283
diff -u -p -r1.283 tc-mips.c
--- gas/config/tc-mips.c	17 Feb 2005 13:46:04 -0000	1.283
+++ gas/config/tc-mips.c	18 Feb 2005 00:11:58 -0000
@@ -5765,15 +5765,14 @@ macro (struct mips_cl_insn *ip)
 	  tempreg = AT;
 	  used_at = 1;
 	}
-      else if (breg == treg
-	       && (offset_expr.X_op != O_constant
-		   || (offset_expr.X_add_number > 0x7fff
-		       || offset_expr.X_add_number < -0x8000)))
-	{
-	  as_bad(_("load expansion needs $at register"));
-	}
       else
 	{
+	  if (breg == treg
+	      && (offset_expr.X_op != O_constant
+		  || (offset_expr.X_add_number > 0x7fff
+		      || offset_expr.X_add_number < -0x8000)))
+	    as_bad(_("load expansion needs $at register"));
+
 	  tempreg = treg;
 	  used_at = 0;
 	}
@@ -5850,15 +5849,14 @@ macro (struct mips_cl_insn *ip)
 	  tempreg = AT;
 	  used_at = 1;
 	}
-      else if (breg == treg
-	       && (offset_expr.X_op != O_constant
-		   || (offset_expr.X_add_number > 0x7fff
-		       || offset_expr.X_add_number < -0x8000)))
-	{
-	  as_bad(_("store expansion needs $at register"));
-	}
       else
 	{
+	  if (breg == treg
+	      && (offset_expr.X_op != O_constant
+		  || (offset_expr.X_add_number > 0x7fff
+		      || offset_expr.X_add_number < -0x8000)))
+	    as_bad(_("store expansion needs $at register"));
+
 	  tempreg = treg;
 	  used_at = 0;
 	}

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: mips warning
  2005-02-18  2:18 ` Alan Modra
@ 2005-02-18 21:18   ` Maciej W. Rozycki
  2005-02-20 15:05   ` Thiemo Seufer
  1 sibling, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2005-02-18 21:18 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On Fri, 18 Feb 2005, Alan Modra wrote:

> > gas/config/tc-mips.c:4171: warning: 'tempreg' may be used uninitialized in this function
> > 	* config/tc-mips.c (macro <ld>): Always set tempreg.
> 
> Ug.  The same is needed for st.
> 
> 	* config/tc-mips.c (macro <ld, st>): Always set tempreg.

 Code in this area is being reworked.  See the thread starting at: 
"http://sourceware.org/ml/binutils/2005-02/msg00366.html".

  Maciej

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

* Re: mips warning
  2005-02-18  2:18 ` Alan Modra
  2005-02-18 21:18   ` Maciej W. Rozycki
@ 2005-02-20 15:05   ` Thiemo Seufer
  1 sibling, 0 replies; 4+ messages in thread
From: Thiemo Seufer @ 2005-02-20 15:05 UTC (permalink / raw)
  To: binutils

Alan Modra wrote:
> On Fri, Feb 18, 2005 at 10:31:11AM +1030, Alan Modra wrote:
> > gas/config/tc-mips.c:4171: warning: 'tempreg' may be used uninitialized in this function
> > 	* config/tc-mips.c (macro <ld>): Always set tempreg.
> 
> Ug.  The same is needed for st.
> 
> 	* config/tc-mips.c (macro <ld, st>): Always set tempreg.

Please don't apply, the code below is broken anyway and will be
removed soon.


Thiemo

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

end of thread, other threads:[~2005-02-18 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-18  2:17 mips warning Alan Modra
2005-02-18  2:18 ` Alan Modra
2005-02-18 21:18   ` Maciej W. Rozycki
2005-02-20 15:05   ` Thiemo Seufer

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).