aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-06-29 20:46:10 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2011-06-29 20:46:10 +0000
commit13408f1edda36e182af15fa250ddd38f52ee8564 (patch)
treed4f317e1adb25590d7cdeef9ae3f0cdeb5be7e2e
parentceb94aa50d68ec7393fac7e2b239aff8ec656f85 (diff)
downloadfsf-binutils-gdb-13408f1edda36e182af15fa250ddd38f52ee8564.zip
fsf-binutils-gdb-13408f1edda36e182af15fa250ddd38f52ee8564.tar.gz
fsf-binutils-gdb-13408f1edda36e182af15fa250ddd38f52ee8564.tar.bz2
gas/
* config/tc-mips.c (append_insn): Always clear the history after an unconditional branch.
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 40f5622..6e2efed 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2011-06-29 Richard Sandiford <rdsandiford@googlemail.com>
+ * config/tc-mips.c (append_insn): Always clear the history after an
+ unconditional branch.
+
+2011-06-29 Richard Sandiford <rdsandiford@googlemail.com>
+
* config/tc-mips.c (find_altered_mips16_opcode): New function.
(append_insn): Use it.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index d8da3d7..2c80793 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -3610,13 +3610,6 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
delay.fixed_p = 1;
insert_into_history (0, 1, &delay);
}
-
- /* If that was an unconditional branch, forget the previous
- insn information. */
- if (pinfo & INSN_UNCOND_BRANCH_DELAY)
- {
- mips_no_prev_insn ();
- }
}
else if (pinfo & INSN_COND_BRANCH_LIKELY)
{
@@ -3633,6 +3626,12 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
else
insert_into_history (0, 1, ip);
+ /* If we have just completed an unconditional branch, clear the history. */
+ if ((history[1].insn_mo->pinfo & INSN_UNCOND_BRANCH_DELAY)
+ || (mips_opts.mips16
+ && (history[0].insn_mo->pinfo & MIPS16_INSN_UNCOND_BRANCH)))
+ mips_no_prev_insn ();
+
/* We just output an insn, so the next one doesn't have a label. */
mips_clear_insn_labels ();
}