This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: patch breaks libgloss builds
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 15 Apr 2005 21:29:06 +0100 (BST)
- Subject: Re: patch breaks libgloss builds
- References: <1113582370.4591.53.camel@localhost.localdomain>
On Fri, 15 Apr 2005, Eric Christopher wrote:
> Building crt0.S we fail on this instruction:
>
> li t2,0xAAAA5555
>
> with a mipsisa64-elf toolchain.
>
> Interestingly enough the code that I think you added in reporting bad
> numbers is failing too:
>
> /dzur/sourceware/combined/libgloss/mips/crt0.S: Assembler messages:
> /dzur/sourceware/combined/libgloss/mips/crt0.S:91: Error: Number
> (0x0aaaa5555) larger than 32 bits
>
> I'll take a look at it later, just noticed it yesterday.
This fixes the problem and I've run the test suite for mips64el-linux-gnu
successfully, but I don't feel that fulfils testing terribly well. A
proper test case for "li"/"dli" should be desirable -- I'll have a look at
it later.
Also it seems we call normalize_constant_expr() a little bit too
extensively -- perhaps a few of these calls could be removed. I think we
have a few explicit sign-extensions elsewhere, too, and some of them could
actually fit into one of these normalize_*() calls.
2005-04-15 Maciej W. Rozycki <macro@linux-mips.org>
* config/tc-mips.c (normalize_constant_expr): Don't check for
HAVE_32BIT_GPRS.
(check_absolute_expr): Only call normalize_constant_expr() if
HAVE_32BIT_GPRS.
(mips_ip): Likewise.
* config/tc-mips.c (check_absolute_expr): Fix formatting.
Maciej
binutils-2.15.96-20050414-mips-gas-li.patch
diff -up --recursive --new-file binutils-2.15.96-20050414.macro/gas/config/tc-mips.c binutils-2.15.96-20050414/gas/config/tc-mips.c
--- binutils-2.15.96-20050414.macro/gas/config/tc-mips.c 2005-04-14 03:25:26.000000000 +0000
+++ binutils-2.15.96-20050414/gas/config/tc-mips.c 2005-04-15 19:25:08.000000000 +0000
@@ -3265,7 +3265,7 @@ static void
*/
normalize_constant_expr (expressionS *ex)
{
- if ((ex->X_op == O_constant && HAVE_32BIT_GPRS)
+ if (ex->X_op == O_constant
&& IS_ZEXT_32BIT_NUM (ex->X_add_number))
ex->X_add_number = (((ex->X_add_number & 0xffffffff) ^ 0x80000000)
- 0x80000000);
@@ -3425,9 +3425,11 @@ check_absolute_expr (struct mips_cl_insn
if (ex->X_op == O_big)
as_bad (_("unsupported large constant"));
else if (ex->X_op != O_constant)
- as_bad (_("Instruction %s requires absolute expression"), ip->insn_mo->name);
+ as_bad (_("Instruction %s requires absolute expression"),
+ ip->insn_mo->name);
- normalize_constant_expr (ex);
+ if (HAVE_32BIT_GPRS)
+ normalize_constant_expr (ex);
}
/* Count the leading zeroes by performing a binary chop. This is a
@@ -8102,7 +8104,8 @@ do_msbd:
if (imm2_expr.X_op != O_big
&& imm2_expr.X_op != O_constant)
insn_error = _("absolute expression required");
- normalize_constant_expr (&imm2_expr);
+ if (HAVE_32BIT_GPRS)
+ normalize_constant_expr (&imm2_expr);
s = expr_end;
continue;
@@ -8570,7 +8573,8 @@ do_msbd:
if (imm_expr.X_op != O_big
&& imm_expr.X_op != O_constant)
insn_error = _("absolute expression required");
- normalize_constant_expr (&imm_expr);
+ if (HAVE_32BIT_GPRS)
+ normalize_constant_expr (&imm_expr);
s = expr_end;
continue;