aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-12-01 08:27:49 +0100
committerJan Beulich <jbeulich@suse.com>2023-12-01 08:27:49 +0100
commit175ce60f0ff7f3423b49c0d41a88a0c51a08ac03 (patch)
tree843ddab0a6d93c961c9e6d543b4db50d3f9e4a01 /gas
parentb5482fe535884c9fdb5c45c5627ec99e54c0e9d9 (diff)
downloadgdb-175ce60f0ff7f3423b49c0d41a88a0c51a08ac03.zip
gdb-175ce60f0ff7f3423b49c0d41a88a0c51a08ac03.tar.gz
gdb-175ce60f0ff7f3423b49c0d41a88a0c51a08ac03.tar.bz2
x86: suppress optimization after potential non-insn
Just like avoiding to do other transformations potentially affected by stand-alone prefixes or direct data emission, also avoid optimization on the following insn.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 059dd49..f2f1e3b 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5120,6 +5120,11 @@ md_assemble (char *line)
retry:
init_globals ();
+ /* Suppress optimization when the last thing we saw may not have been
+ a proper instruction (e.g. a stand-alone prefix or .byte). */
+ if (last_insn->kind != last_insn_other)
+ i.no_optimize = true;
+
/* First parse an instruction mnemonic & call i386_operand for the operands.
We assume that the scrubber has arranged it so that line[0] is the valid
start of a (possibly prefixed) mnemonic. */