x86: fix CMPXCHG8B special case when disallowing q suffix outside of 64-bit mode

Message ID e626178a-b6c2-4d0d-42a0-c16ae63db025@suse.com
State New
Headers show
Series
  • x86: fix CMPXCHG8B special case when disallowing q suffix outside of 64-bit mode
Related show

Commit Message

Jan Beulich via Binutils March 24, 2021, 1:58 p.m.
In match_template() i.tm hasn't been filled yet, so it is necessarily t
which needs checking. This is only a latent issue as no other templates
with the same base_opcode have an extension_opcode of 1.

gas/
2021-03-XX  Jan Beulich  <jbeulich@suse.com>

	* config/tc-i386.c (match_template): Use t instead of i.tm.

Comments

Jan Beulich via Binutils March 24, 2021, 2:03 p.m. | #1
On Wed, Mar 24, 2021 at 6:59 AM Jan Beulich <jbeulich@suse.com> wrote:
>

> In match_template() i.tm hasn't been filled yet, so it is necessarily t

> which needs checking. This is only a latent issue as no other templates

> with the same base_opcode have an extension_opcode of 1.

>

> gas/

> 2021-03-XX  Jan Beulich  <jbeulich@suse.com>

>

>         * config/tc-i386.c (match_template): Use t instead of i.tm.

>

> --- a/gas/config/tc-i386.c

> +++ b/gas/config/tc-i386.c

> @@ -6290,7 +6290,7 @@ match_template (char mnem_suffix)

>        if (((i.suffix == QWORD_MNEM_SUFFIX

>             && flag_code != CODE_64BIT

>             && !(t->base_opcode == 0xfc7

> -                && i.tm.opcode_modifier.opcodeprefix == PREFIX_NONE

> +                && t->opcode_modifier.opcodeprefix == PREFIX_NONE

>                  && t->extension_opcode == 1) /* cmpxchg8b */)

>            || (i.suffix == LONG_MNEM_SUFFIX

>                && !cpu_arch_flags.bitfield.cpui386))


OK.  Thanks.

-- 
H.J.

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -6290,7 +6290,7 @@  match_template (char mnem_suffix)
       if (((i.suffix == QWORD_MNEM_SUFFIX
 	    && flag_code != CODE_64BIT
 	    && !(t->base_opcode == 0xfc7
-		 && i.tm.opcode_modifier.opcodeprefix == PREFIX_NONE
+		 && t->opcode_modifier.opcodeprefix == PREFIX_NONE
 		 && t->extension_opcode == 1) /* cmpxchg8b */)
 	   || (i.suffix == LONG_MNEM_SUFFIX
 	       && !cpu_arch_flags.bitfield.cpui386))