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
Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de> writes:
> > IMHO the right solution is to fix these 32 bit values after each
> > call of my_getExpression().
>
> Well, that's my take of it.
Hmmm. It currently works to pass O_big to case 'I'. Your patch would
change that. There is a bunch of code in load_register() to handle
O_big. Are we sure it is correct to discard that code?
> + if (ex->X_op == O_constant && HAVE_32BIT_GPRS)
> + {
> + if (ex->X_add_number < 0)
> + ex->X_add_number = ((ex->X_add_number + 0x80000000) & 0xffffffff)
> + - 0x80000000;
> + else
> + ex->X_add_number &= 0xffffffff;
> + }
If X_add_number is a 64-bit value, then it doesn't make sense to check
whether it is negative in the 64-bit sense and then try to negate it
in the 32-bit sense. I think you mean to write
if ((ex->X_add_number & 0x80000000) != 0)
Ian