x86: fix register check in check_qword_reg()
authorJan Beulich <jbeulich@novell.com>
Tue, 5 Jul 2016 09:14:51 +0000 (11:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Jul 2016 09:14:51 +0000 (11:14 +0200)
A missing 'r' (or wrong 'e') register prefix needs to be complained
about if the template allows for a 64-bit register, not a 32-bit one.
I assume this was a copy-and-paste type of mistake
(from check_long_reg()).

gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/x86-64-suffix-bad.l
gas/testsuite/gas/i386/x86-64-suffix-bad.s

index 9e24bcd45a8b8c18ede726ad937c03a931efed99..d4f2e9b72cecba885aa891dfb386f24638ae6ccd 100644 (file)
@@ -1,3 +1,12 @@
+2016-07-04  Jan Beulich  <jbeulich@suse.com>
+
+       * config/tc-i386.c (check_qword_reg): Correct register kind
+       checked.
+       * testsuite/gas/i386/x86-64-suffix-bad.s: Add q-suffix with
+       16-bit register cases.
+       * testsuite/gas/i386/x86-64-suffix-bad.l: Adjust expectations.
+
+
 2016-07-02  Maciej W. Rozycki  <macro@imgtec.com>
 
        * testsuite/gas/mips/ecoff@ld.d: Remove test.
index 4ba05baccb3029e5ed56f56a385402812d1984c8..a3b85c86553a33356f977851e3cd0958158cc13b 100644 (file)
@@ -5670,7 +5670,7 @@ check_qword_reg (void)
     /* Warn if the r prefix on a general reg is missing.  */
     else if ((i.types[op].bitfield.reg16
              || i.types[op].bitfield.reg32)
-            && (i.tm.operand_types[op].bitfield.reg32
+            && (i.tm.operand_types[op].bitfield.reg64
                 || i.tm.operand_types[op].bitfield.acc))
       {
        /* Prohibit these changes in the 64bit mode, since the
index febdc0c48f6aeac74549f750cb480e9cecebab58..00adbf0cd4dabf00a5c9f4fba0610d4bc42a5d98 100644 (file)
@@ -11,3 +11,7 @@
 .*:15: Error: .*
 .*:16: Error: .*
 .*:17: Error: .*
+.*:19: Error: .*
+.*:20: Error: .*
+.*:21: Error: .*
+.*:22: Error: .*
index c4462f6c02d624f83f1a905e1e17e7b810ca4559..83837f5a9e5c0b95ec490aef05528e2391c8f720 100644 (file)
@@ -15,3 +15,8 @@ start:
        orb     %rax, (%rax)
        orw     %rax, (%rax)
        orl     %rax, (%rax)
+
+       pushq   %ax
+       popq    %ax
+       callq   *%ax
+       jmpq    *%ax