Index: gas/config/tc-v850.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-v850.c,v retrieving revision 1.53 diff -u -p -r1.53 tc-v850.c --- gas/config/tc-v850.c 17 Oct 2007 16:45:55 -0000 1.53 +++ gas/config/tc-v850.c 25 Apr 2008 05:50:37 -0000 @@ -25,6 +25,17 @@ #include "opcode/v850.h" #include "dwarf2dbg.h" +#ifdef HAVE_LIMITS_H +#include +#else +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#ifndef LONG_MAX +#define LONG_MAX (long) (((unsigned long) (-1)) >> 1) +#endif +#endif + /* Sign-extend a 16-bit number. */ #define SEXT16(x) ((((x) & 0xffff) ^ (~0x7fff)) + 0x8000) @@ -1528,7 +1539,10 @@ v850_insert_operand (unsigned long insn, } else { - max = (1 << operand->bits) - 1; + if (operand->bits == -1) + max = LONG_MAX; + else + max = (1 << operand->bits) - 1; if (! warn_unsigned_overflows) min = -(1 << (operand->bits - 1));