diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-04-25 11:16:07 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-04-25 11:16:07 +0200 |
commit | 408ab0161d09ff29e258c8ff1bb02ec5e084087c (patch) | |
tree | cc7107427687e6ab89aa941bc28ae061334e8af1 /gas | |
parent | 85bd4bfb7f4e1adf4d3864df9ee16f9597fe15b4 (diff) | |
download | gdb-408ab0161d09ff29e258c8ff1bb02ec5e084087c.zip gdb-408ab0161d09ff29e258c8ff1bb02ec5e084087c.tar.gz gdb-408ab0161d09ff29e258c8ff1bb02ec5e084087c.tar.bz2 |
RISC-V: drop "percent_op" parameter from my_getOpcodeExpression()
Both callers check for no relocations, so there's no point parsing for
some. Have the function pass percent_op_null into
my_getSmallExpression(). Note that there's no point passing
percent_op_itype: Elsewhere, especially when processing compressed alias
insns ahead of non-alias ones, this has the effect of avoiding "bad
expression" errors when another parsing pass may follow (and succeed).
Here, however, all alternative forms of an insn type will again start
with the same O4 or O2, so avoiding errors earlier on doesn't really
help. Plus constructs with a relocation specifier (as percent_op_itype
would permit) can't be specified anyway, as the scrubber eats the
whitespace between .insn's type and the O4 or O2 expression when that
starts with % or ( - i.e. these will be seen as e.g. "i%lo(x)", and
riscv_ip() looks only for whitespace when finding the end of a mnemonic.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-riscv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 82dfea1..160161c 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2299,7 +2299,7 @@ my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, static size_t my_getOpcodeExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, - char *str, const struct percent_op_match *percent_op) + char *str) { const struct opcode_name_t *o = opcode_name_lookup (&str); @@ -2310,7 +2310,7 @@ my_getOpcodeExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, return 0; } - return my_getSmallExpression (ep, reloc, str, percent_op); + return my_getSmallExpression (ep, reloc, str, percent_op_null); } /* Parse string STR as a vsetvli operand. Store the expression in *EP. @@ -3314,7 +3314,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, switch (*++oparg) { case '4': - if (my_getOpcodeExpression (imm_expr, imm_reloc, asarg, p) + if (my_getOpcodeExpression (imm_expr, imm_reloc, asarg) || imm_expr->X_op != O_constant || imm_expr->X_add_number < 0 || imm_expr->X_add_number >= 128 @@ -3331,7 +3331,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr, continue; case '2': - if (my_getOpcodeExpression (imm_expr, imm_reloc, asarg, p) + if (my_getOpcodeExpression (imm_expr, imm_reloc, asarg) || imm_expr->X_op != O_constant || imm_expr->X_add_number < 0 || imm_expr->X_add_number >= 3) |