i386: Don't add 0x66 prefix to IRET for .code16gcc
[deliverable/binutils-gdb.git] / gas / config / tc-i386.c
index 5eb6c4c2692d4aafdd495db3294ef065fecf43a5..032b1d308115d3f8a95b0d1f8ba169011292a8e3 100644 (file)
@@ -6352,7 +6352,13 @@ process_suffix (void)
            if (!add_prefix (ADDR_PREFIX_OPCODE))
              return 0;
        }
+      /* stackop_size is set to LONG_MNEM_SUFFIX for the .code16gcc
+        directive to support 16bit mode with 32-bit address.  Since
+        IRET (opcode 0xcf) in 16bit mode returns from an interrupt
+        in 16bit mode, we shouldn't add DATA_PREFIX_OPCODE here.  */
       else if (i.suffix != QWORD_MNEM_SUFFIX
+              && (stackop_size != LONG_MNEM_SUFFIX
+                  || i.tm.base_opcode != 0xcf)
               && !i.tm.opcode_modifier.ignoresize
               && !i.tm.opcode_modifier.floatmf
               && !i.tm.opcode_modifier.vex
This page took 0.024674 seconds and 4 git commands to generate.