i386.c (ix86_print_operand_address_as): Do not check index when encoding %esp as...
authorUros Bizjak <ubizjak@gmail.com>
Thu, 28 Sep 2017 18:14:27 +0000 (20:14 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 28 Sep 2017 18:14:27 +0000 (20:14 +0200)
* config/i386/i386.c (ix86_print_operand_address_as): Do not check
index when encoding %esp as %rsp to avoid 0x67 prefix.

From-SVN: r253260

gcc/ChangeLog
gcc/config/i386/i386.c

index c8b67cd..2802cdf 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-28  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.c (ix86_print_operand_address_as): Do not check
+       index when encoding %esp as %rsp to avoid 0x67 prefix.
+
 2017-09-28  Sergey Shalnov  <Sergey.Shalnov@intel.com>
 
        * config/i386/i386.md (*movsf_internal, *movdf_internal):
index 63db7ac..e282546 100644 (file)
@@ -19953,12 +19953,11 @@ ix86_print_operand_address_as (FILE *file, rtx addr,
          code = 'k';
        }
 
-      /* Since the upper 32 bits of RSP are always zero for x32, we can
-        encode %esp as %rsp to avoid 0x67 prefix if there is no index or
-        base register.  */
+      /* Since the upper 32 bits of RSP are always zero for x32,
+        we can encode %esp as %rsp to avoid 0x67 prefix if
+        there is no index register.  */
       if (TARGET_X32 && Pmode == SImode
-         && ((!index && base && REG_P (base) && REGNO (base) == SP_REG)
-             || (!base && index && REGNO (index) == SP_REG)))
+         && !index && base && REG_P (base) && REGNO (base) == SP_REG)
        code = 'q';
 
       if (ASSEMBLER_DIALECT == ASM_ATT)