This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
mips warning
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Fri, 18 Feb 2005 10:31:11 +1030
- Subject: mips warning
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