aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-06-23 20:21:38 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2011-06-23 20:21:38 +0000
commitf77ef3e29a6246edee20b5908e99b2c92f245a6b (patch)
tree41bdae0929facb1bad3db39be83435385315050b /gas/config
parent6e586cc56592f85535f788391b4f48025311b465 (diff)
downloadgdb-f77ef3e29a6246edee20b5908e99b2c92f245a6b.zip
gdb-f77ef3e29a6246edee20b5908e99b2c92f245a6b.tar.gz
gdb-f77ef3e29a6246edee20b5908e99b2c92f245a6b.tar.bz2
gas/
PR gas/12915 * config/tc-mips.c (append_insn): Only consider hazards between the pre-noreorder block and ip. gas/testsuite/ * gas/mips/pr12915.s, gas/mips/pr12915.d: New test. * gas/mips/mips.exp: Run it.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mips.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 33d8896..8430883 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -3154,8 +3154,18 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
}
else if (mips_relax.sequence != 2 && prev_nop_frag != NULL)
{
- /* Work out how many nops in prev_nop_frag are needed by IP. */
- int nops = nops_for_insn_or_target (history, ip);
+ struct mips_cl_insn stubbed_history[ARRAY_SIZE (history)];
+ int nops, i;
+
+ /* Work out how many nops in prev_nop_frag are needed by IP.
+ Base this on a history in which all insns since prev_nop_frag
+ are stubbed out with nops. */
+ for (i = 0; i < (int) ARRAY_SIZE (history); i++)
+ if (i < prev_nop_frag_since)
+ stubbed_history[i] = *NOP_INSN;
+ else
+ stubbed_history[i] = history[i];
+ nops = nops_for_insn_or_target (stubbed_history, ip);
gas_assert (nops <= prev_nop_frag_holds);
/* Enforce NOPS as a minimum. */