diff options
author | Chao-ying Fu <fu@mips.com> | 2013-05-01 01:02:01 +0000 |
---|---|---|
committer | Chao-ying Fu <fu@mips.com> | 2013-05-01 01:02:01 +0000 |
commit | f02d83189ef10e2cec76d5319fdf94971b46e164 (patch) | |
tree | e18121caa3a0c7714d86e40d169ff0e89ffb4cf2 | |
parent | 49fcdb99e2b3013fe4751c9fed42034507906358 (diff) | |
download | binutils-f02d83189ef10e2cec76d5319fdf94971b46e164.zip binutils-f02d83189ef10e2cec76d5319fdf94971b46e164.tar.gz binutils-f02d83189ef10e2cec76d5319fdf94971b46e164.tar.bz2 |
2013-04-30 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
* config/tc-mips.c (mips_ip): Add sizelo.
For "+C", "+G", and "+H", set sizelo and compare against it.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index ec756d8..f152068 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2013-04-30 Chao-ying Fu <Chao-ying.Fu@imgtec.com> + + * config/tc-mips.c (mips_ip): Add sizelo. + For "+C", "+G", and "+H", set sizelo and compare against it. + 2013-04-29 Nick Clifton <nickc@redhat.com> * as.c (Options): Add -gdwarf-sections. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index a9b46e9..29d2c02 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -10790,6 +10790,7 @@ mips_ip (char *str, struct mips_cl_insn *ip) unsigned int destregno = 0; unsigned int lastpos = 0; unsigned int limlo, limhi; + int sizelo; char *s_reset; offsetT min_range, max_range; long opend; @@ -11374,23 +11375,25 @@ mips_ip (char *str, struct mips_cl_insn *ip) case 'C': /* ext size, becomes MSBD. */ limlo = 1; limhi = 32; + sizelo = 1; goto do_msbd; case 'G': limlo = 33; limhi = 64; + sizelo = 33; goto do_msbd; case 'H': limlo = 33; limhi = 64; + sizelo = 1; goto do_msbd; do_msbd: my_getExpression (&imm_expr, s); check_absolute_expr (ip, &imm_expr); - /* Check for negative input so that small negative numbers - will not succeed incorrectly. The checks against - (pos+size) transitively check "size" itself, - assuming that "pos" is reasonable. */ - if ((long) imm_expr.X_add_number < 0 + /* The checks against (pos+size) don't transitively check + "size" itself, assuming that "pos" is reasonable. + We also need to check the lower bound of "size". */ + if ((long) imm_expr.X_add_number < sizelo || ((unsigned long) imm_expr.X_add_number + lastpos) < limlo || ((unsigned long) imm_expr.X_add_number |