aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-12-04 10:44:27 +0100
committerJan Beulich <jbeulich@suse.com>2019-12-04 10:44:27 +0100
commitd488367a421f4c4fd47d37ae0013318024b1019b (patch)
tree2e7cf0601770ff42699ff8d2fa16afd9f20e217d /gas/config
parent319ff62c8ab28c846365aef65c137735f8af88cb (diff)
downloadgdb-d488367a421f4c4fd47d37ae0013318024b1019b.zip
gdb-d488367a421f4c4fd47d37ae0013318024b1019b.tar.gz
gdb-d488367a421f4c4fd47d37ae0013318024b1019b.tar.bz2
x86-64/Intel: fix CALL/JMP with dword operand
While dc2be329b950 ("i386: Only check suffix in instruction mnemonic") has made the assembler accept these in the first place (they were wrongly rejected before), the generated code was still wrong in that it lacked an operand size override. (In 64-bit code, other than in 16- and 32-bit ones, CALL and JMP with memory operands are all entirely unambiguous: No operand size can have two meanings.)
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386-intel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c
index 49f558d..51fa38d 100644
--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -657,11 +657,12 @@ i386_intel_operand (char *operand_string, int got_a_float)
&& current_templates->start->name[3] == 0)
|| current_templates->start->base_opcode == 0x62 /* bound */)
suffix = WORD_MNEM_SUFFIX;
- else if (flag_code == CODE_16BIT
+ else if (flag_code != CODE_32BIT
&& (current_templates->start->opcode_modifier.jump == JUMP
|| current_templates->start->opcode_modifier.jump
== JUMP_DWORD))
- suffix = LONG_DOUBLE_MNEM_SUFFIX;
+ suffix = flag_code == CODE_16BIT ? LONG_DOUBLE_MNEM_SUFFIX
+ : WORD_MNEM_SUFFIX;
else if (got_a_float == 1) /* "f..." */
suffix = SHORT_MNEM_SUFFIX;
else