From 173d34478ad14ae35df062b2240b0d830a83cf31 Mon Sep 17 00:00:00 2001 From: Chao-ying Fu Date: Thu, 12 Sep 2013 21:41:09 +0000 Subject: [PATCH] 2013-09-12 Chao-ying Fu * config/tc-mips.c (match_insn): Set error when $31 is used for bltzal* and bgezal*. --- gas/ChangeLog | 5 +++++ gas/config/tc-mips.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 89c9cc9b556..8434721a206 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2013-09-12 Chao-ying Fu + + * config/tc-mips.c (match_insn): Set error when $31 is used for + bltzal* and bgezal*. + 2013-09-04 Tristan Gingold * config/tc-ppc.c (md_apply_fix): Handle defined after use toc diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index ca95922ef3c..ff1c610d605 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -7091,6 +7091,10 @@ match_insn (struct mips_cl_insn *insn, const struct mips_opcode *opcode, set_insn_error (0, _("a destination register must be supplied")); } + else if (arg.last_regno == 31 + && (strncmp (insn->insn_mo->name, "bltzal", 6) == 0 + || strncmp (insn->insn_mo->name, "bgezal", 6) == 0)) + set_insn_error (0, _("the source register must not be $31")); check_completed_insn (&arg); return TRUE; } -- 2.30.2