This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: mipsisa32-unknown-elf-as: Error: too large constant specified
Eric Christopher <echristo@redhat.com> writes:
> > - ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000)
> > - - 0x80000000);
> > + ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000)
> > + - 0x80000000);
> >
>
> Unless I'm going blind these changes appear to be whitespace?
They are whitespace. The indentation was incorrect. Sorry. Here is
a diff -b.
Ian
Index: tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.234
diff -u -b -r1.234 tc-mips.c
--- tc-mips.c 1 Oct 2003 18:57:16 -0000 1.234
+++ tc-mips.c 15 Oct 2003 00:26:21 -0000
@@ -820,6 +820,10 @@
(((x) &~ (offsetT) 0x7fff) == 0 \
|| (((x) &~ (offsetT) 0x7fff) == ~ (offsetT) 0x7fff))
+/* Is the given value a 32-bit value? */
+#define IS_32BIT_NUM(x) \
+ (((x) &~ (offsetT) 0xffffffff) == 0 \
+ || (((x) &~ (offsetT) 0xffffffff) == ~ (offsetT) 0xffffffff))
/* Prototypes for static functions. */
@@ -3270,8 +3274,8 @@
if (! dbl && ! ((ep->X_add_number & ~((bfd_vma) 0x7fffffff))
== ~((bfd_vma) 0x7fffffff)))
{
- if (ep->X_add_number & ~((bfd_vma) 0xffffffff))
- as_bad (_("too large constant specified"));
+ if (! IS_32BIT_NUM (ep->X_add_number))
+ as_bad (_("constant too large"));
ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000)
- 0x80000000);
@@ -3434,8 +3438,8 @@
if (! dbl && ! ((ep->X_add_number & ~((bfd_vma) 0x7fffffff))
== ~((bfd_vma) 0x7fffffff)))
{
- if (ep->X_add_number & ~((bfd_vma) 0xffffffff))
- as_bad (_("too large constant specified"));
+ if (! IS_32BIT_NUM (ep->X_add_number))
+ as_bad (_("constant too large"));
ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000)
- 0x80000000);
@@ -5945,8 +5949,8 @@
&& ! ((offset_expr.X_add_number & ~((bfd_vma) 0x7fffffff))
== ~((bfd_vma) 0x7fffffff)))
{
- if (offset_expr.X_add_number & ~((bfd_vma) 0xffffffff))
- as_bad (_("too large constant specified"));
+ if (! IS_32BIT_NUM (offset_expr.X_add_number))
+ as_bad (_("constant too large"));
offset_expr.X_add_number = (((offset_expr.X_add_number & 0xffffffff)
^ 0x80000000) - 0x80000000);