diff options
author | Thiemo Seufer <ths@networkno.de> | 2003-10-01 18:57:16 +0000 |
---|---|---|
committer | Thiemo Seufer <ths@networkno.de> | 2003-10-01 18:57:16 +0000 |
commit | d17e7bce1eb77c855917a6fb06433382883a623d (patch) | |
tree | ae509dd7bc1111983e32794f494bc63e91920d70 | |
parent | 64f395bf19e16d115a17e91e62070032ba0553c5 (diff) | |
download | gdb-d17e7bce1eb77c855917a6fb06433382883a623d.zip gdb-d17e7bce1eb77c855917a6fb06433382883a623d.tar.gz gdb-d17e7bce1eb77c855917a6fb06433382883a623d.tar.bz2 |
* config/tc-mips.c (macro_build_ldst_constoffset,load_register,macro):
Unbreak overflow checks.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 19 |
2 files changed, 15 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 70396f5..0f4d6e9 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2003-10-01 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> + + * config/tc-mips.c (macro_build_ldst_constoffset,load_register,macro): + Unbreak overflow checks. + 2003-10-01 Chris Demetriou <cgd@broadcom.com> * config/tc-mips.c (s_cpreturn): Correct errors in comment. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 644e76a..cd1b424 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -3267,10 +3267,10 @@ macro_build_ldst_constoffset (char *place, int *counter, expressionS *ep, assert (ep->X_op == O_constant); /* Sign-extending 32-bit constants makes their handling easier. */ - if (! dbl) + if (! dbl && ! ((ep->X_add_number & ~((bfd_vma) 0x7fffffff)) + == ~((bfd_vma) 0x7fffffff))) { - if (ep->X_add_number & ~((bfd_vma) 0x7fffffff) - && ~(ep->X_add_number | 0x7fffffff)) + if (ep->X_add_number & ~((bfd_vma) 0xffffffff)) as_bad (_("too large constant specified")); ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000) @@ -3431,10 +3431,10 @@ load_register (int *counter, int reg, expressionS *ep, int dbl) assert (ep->X_op == O_constant); /* Sign-extending 32-bit constants makes their handling easier. */ - if (! dbl) + if (! dbl && ! ((ep->X_add_number & ~((bfd_vma) 0x7fffffff)) + == ~((bfd_vma) 0x7fffffff))) { - if (ep->X_add_number & ~((bfd_vma) 0x7fffffff) - && ~(ep->X_add_number | 0x7fffffff)) + if (ep->X_add_number & ~((bfd_vma) 0xffffffff)) as_bad (_("too large constant specified")); ep->X_add_number = (((ep->X_add_number & 0xffffffff) ^ 0x80000000) @@ -5941,10 +5941,11 @@ macro (struct mips_cl_insn *ip) described below. */ if ((! HAVE_64BIT_ADDRESSES && (! HAVE_64BIT_GPRS && offset_expr.X_op == O_constant)) - && (offset_expr.X_op == O_constant)) + && (offset_expr.X_op == O_constant) + && ! ((offset_expr.X_add_number & ~((bfd_vma) 0x7fffffff)) + == ~((bfd_vma) 0x7fffffff))) { - if (offset_expr.X_add_number & ~((bfd_vma) 0x7fffffff) - && ~(offset_expr.X_add_number | 0x7fffffff)) + if (offset_expr.X_add_number & ~((bfd_vma) 0xffffffff)) as_bad (_("too large constant specified")); offset_expr.X_add_number = (((offset_expr.X_add_number & 0xffffffff) |