This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] x86: fix register check in check_qword_reg()


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/
2016-07-04  Jan Beulich  <jbeulich@suse.com>

	* config/tc-i386.c (check_qword_reg): Correct register kind
	checked.

gas/testsuite/
2016-07-04  Jan Beulich  <jbeulich@suse.com>

	* gas/i386/x86-64-suffix-bad.s: Add q-suffix with 16-bit
	register cases.
	* gas/i386/x86-64-suffix-bad.l: Adjust expectations.

--- 2016-07-01/gas/config/tc-i386.c
+++ 2016-07-01/gas/config/tc-i386.c
@@ -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
--- 2016-07-01/gas/testsuite/gas/i386/x86-64-suffix-bad.l
+++ 2016-07-01/gas/testsuite/gas/i386/x86-64-suffix-bad.l
@@ -11,3 +11,7 @@
 .*:15: Error: .*
 .*:16: Error: .*
 .*:17: Error: .*
+.*:19: Error: .*
+.*:20: Error: .*
+.*:21: Error: .*
+.*:22: Error: .*
--- 2016-07-01/gas/testsuite/gas/i386/x86-64-suffix-bad.s
+++ 2016-07-01/gas/testsuite/gas/i386/x86-64-suffix-bad.s
@@ -15,3 +15,8 @@ start:
 	orb	%rax, (%rax)
 	orw	%rax, (%rax)
 	orl	%rax, (%rax)
+
+	pushq	%ax
+	popq	%ax
+	callq	*%ax
+	jmpq	*%ax




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]