diff --git a/gas/ChangeLog b/gas/ChangeLog index 300d5ca37b..4459273acc 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2016-06-30 Maciej W. Rozycki + + * config/tc-mips.c (append_insn): Simplify non-MIPS16 branch + swapping sequence. + 2016-06-30 Maciej W. Rozycki PR gas/20312 diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 092e7b430d..77ba0c9226 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -7537,9 +7537,10 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, } else { - move_insn (&delay, ip->frag, - ip->where - branch_disp + insn_length (ip)); - move_insn (ip, history[0].frag, history[0].where); + /* If this is not a relaxed branch and we are in the + same frag, then just swap the instructions. */ + move_insn (ip, delay.frag, delay.where); + move_insn (&delay, ip->frag, ip->where + insn_length (ip)); } history[0] = *ip; delay.fixed_p = 1;