diff options
author | David Ung <davidu@mips.com> | 2005-09-01 16:35:41 +0000 |
---|---|---|
committer | David Ung <davidu@mips.com> | 2005-09-01 16:35:41 +0000 |
commit | e9df6573ba865dc6aa5328277ad81922a7ac3ee3 (patch) | |
tree | 1657741f7f0d11fde3749e887e26b114bdb01ea0 /gas/config/tc-mips.c | |
parent | 84320456461de4db843a980c115aef27d107b126 (diff) | |
download | gdb-e9df6573ba865dc6aa5328277ad81922a7ac3ee3.zip gdb-e9df6573ba865dc6aa5328277ad81922a7ac3ee3.tar.gz gdb-e9df6573ba865dc6aa5328277ad81922a7ac3ee3.tar.bz2 |
* config/tc-mips.c (append_insn): Correctly handle mips16 case
when the frags are different for the 2 instructions we want to
swap. If the lengths of the 2 instructions are not the same, we
won't do the swap but emit an nop.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r-- | gas/config/tc-mips.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 37d2613..a2879b1 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -2698,9 +2698,22 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, struct mips_cl_insn delay = history[0]; if (mips_opts.mips16) { - know (delay.frag == ip->frag); - move_insn (ip, delay.frag, delay.where); - move_insn (&delay, ip->frag, ip->where + insn_length (ip)); + if (delay.frag == ip->frag) + { + move_insn (ip, delay.frag, delay.where); + move_insn (&delay, ip->frag, delay.where + + insn_length (ip)); + } + else if (insn_length (ip) == insn_length (&delay)) + { + move_insn (&delay, ip->frag, ip->where); + move_insn (ip, history[0].frag, history[0].where); + } + else + { + add_fixed_insn (NOP_INSN); + delay = *NOP_INSN; + } } else if (relaxed_branch) { |