summaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2013-07-08 08:39:31 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2013-07-08 08:39:31 +0000
commit31a08ad39d8f537023cfdf8018f16abf20eb9db2 (patch)
tree784b16ab801a23d4c2487df89620af60aa41c136 /gas/config
parent5da3449a26c1942af6ba025b83157a1add3bc061 (diff)
downloadbinutils-redhat-31a08ad39d8f537023cfdf8018f16abf20eb9db2.tar.gz
gas/
* config/tc-mips.c (mips_ip): Unconditionally parse an expression for 'A' and assume that the constant has been elided if the result is an O_register. gas/testsuite/ * gas/mips/la.s, gas/mips/la.d, gas/mips/la-svr4pic.d, gas/mips/la-xgot.d: Add tests for bracketed addresses.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mips.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 5c6424e9f1..22ba44aded 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -12702,17 +12702,17 @@ mips_ip (char *str, struct mips_cl_insn *ip)
continue;
case 'A':
- /* If we expect a base register, check whether there is only
- a single bracketed expression left. If so, it must be the
- base register and the constant must be zero. */
- if (args[1] == '(' && *s == '(' && strchr (s + 1, '(') == 0)
+ my_getSmallExpression (&offset_expr, offset_reloc, s);
+ if (offset_expr.X_op == O_register)
{
+ /* Assume that the offset has been elided and that what
+ we saw was a base register. The match will fail later
+ if that assumption turns out to be wrong. */
offset_expr.X_op = O_constant;
offset_expr.X_add_number = 0;
}
else
{
- my_getSmallExpression (&offset_expr, offset_reloc, s);
normalize_address_expr (&offset_expr);
s = expr_end;
}