aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-02-14 14:04:23 +0100
committerJan Beulich <jbeulich@suse.com>2020-02-14 14:04:23 +0100
commitb6773884364e0275a793adad4b025913fa155d5a (patch)
tree4658777b7d567dda75bd6d901649f140f8597332 /gas/config
parent92334ad2c6ad3aef4f78894c4d0f2794255317b3 (diff)
downloadgdb-b6773884364e0275a793adad4b025913fa155d5a.zip
gdb-b6773884364e0275a793adad4b025913fa155d5a.tar.gz
gdb-b6773884364e0275a793adad4b025913fa155d5a.tar.bz2
x86: adjust segment override prefix emission
Since we already suppress the prefix altogether when it's the default one for the chosen addressing mode, let's do so also when instruction prefix and override specified with the memory operand match. (Note that insn prefix specified segment overrides never get discarded.)
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index d7d45de..0e60919 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7178,11 +7178,13 @@ duplicate:
}
/* If a segment was explicitly specified, and the specified segment
- is not the default, use an opcode prefix to select it. If we
- never figured out what the default segment is, then default_seg
- will be zero at this point, and the specified segment prefix will
- always be used. */
- if ((i.seg[0]) && (i.seg[0] != default_seg))
+ is neither the default nor the one already recorded from a prefix,
+ use an opcode prefix to select it. If we never figured out what
+ the default segment is, then default_seg will be zero at this
+ point, and the specified segment prefix will always be used. */
+ if (i.seg[0]
+ && i.seg[0] != default_seg
+ && i.seg[0]->seg_prefix != i.prefix[SEG_PREFIX])
{
if (!add_prefix (i.seg[0]->seg_prefix))
return 0;