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
Ian Lance Taylor <ian@wasabisystems.com> writes:
> Nigel Stephens <nigel@mips.com> writes:
>
> > I believe that this new behaviour is broken.
>
> cgd@broadcom.com writes:
>
> > I'd guess this is a recent regression.
>
> Hey, I'm easy. Any opinions on this patch? I haven't tried the
> testsuite yet. In any case, clearly some new tests are called for
> here.
Just to spell it out, that patch is a hack on the current behaviour.
It would be more correct, or perhaps I should say less likely to lead
to surprises, to actually compute using 32 bit arithmetic. But that
would require some real work on expr.c, which right happily does stuff
like:
else if (c == '~' || c == '"')
expressionP->X_add_number = ~ expressionP->X_add_number;
X_add_number has type offsetT aka bfd_signed_vma. When targeting
MIPS, that will often be a 64-bit type, because many MIPS targets
include a 64-bit BFD target vector.
With the patch I sent out, code like this will assemble without a
warning on a 32-bit target:
and $2, $2, 0xffffffffe0000000
which is somewhat dubious.
Ian