public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: binutils@sources.redhat.com
Subject: mips warning
Date: Fri, 18 Feb 2005 02:17:00 -0000	[thread overview]
Message-ID: <20050218000111.GD10128@bubble.modra.org> (raw)

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

             reply	other threads:[~2005-02-18  0:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18  2:17 Alan Modra [this message]
2005-02-18  2:18 ` Alan Modra
2005-02-18 21:18   ` Maciej W. Rozycki
2005-02-20 15:05   ` Thiemo Seufer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050218000111.GD10128@bubble.modra.org \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).