Revert "x86: Update segment register check in Intel syntax"
authorJan Beulich <jbeulich@novell.com>
Thu, 30 Nov 2017 10:44:27 +0000 (11:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 30 Nov 2017 10:44:27 +0000 (11:44 +0100)
This reverts commit 4d36230d59903b92fbe2b53b31ed64a884860f0e.
I was committed without maintainer ack and regresses intended
functionality. A replacement will be committed shortly.

gas/ChangeLog
gas/config/tc-i386-intel.c
gas/testsuite/gas/i386/intelok.s
gas/testsuite/gas/i386/inval-seg.l
gas/testsuite/gas/i386/inval-seg.s
gas/testsuite/gas/i386/x86-64-inval-seg.l
gas/testsuite/gas/i386/x86-64-inval-seg.s

index ab979a31edbf43461baea28403a6c187832a1e69..1b6401fe17fbd2eea9739dcb7301b6e6bd2adbed 100644 (file)
        * testsuite/gas/elf/dwarf2-6.d: Likewise.
        * testsuite/gas/elf/dwarf2-7.d: Likewise.
 
-2017-08-01  H.J. Lu  <hongjiu.lu@intel.com>
-
-       PR gas/21874
-       * config/tc-i386-intel.c (i386_intel_operand): Update segment
-       register check.
-       * testsuite/gas/i386/intelok.s: Replace "fs:gs:[eax]" with
-       "fs:[eax]".
-       * testsuite/gas/i386/inval-seg.s: Add tests for invalid segment
-       register.
-       * testsuite/gas/i386/x86-64-inval-seg.s: Likewise.
-       * testsuite/gas/i386/inval-seg.l: Updated.
-       * testsuite/gas/i386/x86-64-inval-seg.l: Likewise.
-
 2017-07-31  John David Anglin  <danglin@gcc.gnu.org>
 
        * config/tc-hppa.c (pa_ip): Clear `d' bit in branch on bit instructions
index 79fe0b47d4589f770fd986d5bc1909933c6d0dda..74aae24c41ba80c7ce5dc68104c4cdc43ec03148 100644 (file)
@@ -956,7 +956,13 @@ i386_intel_operand (char *operand_string, int got_a_float)
 
       if (intel_state.seg)
        {
-         expP = symbol_get_value_expression (intel_state.seg);
+         for (;;)
+           {
+             expP = symbol_get_value_expression (intel_state.seg);
+             if (expP->X_op != O_full_ptr)
+               break;
+             intel_state.seg = expP->X_add_symbol;
+           }
          if (expP->X_op != O_register)
            {
              as_bad (_("segment register name expected"));
index 4c16613e54dfb2d7512e0e1ace71a49008265181..eae9c2d50923e1067bb1436a917d0556ca9fd7bd 100644 (file)
@@ -150,7 +150,7 @@ start:
        mov     eax, [eax[ecx]]
        mov     eax, [[eax][ecx]]
        mov     eax, es:[eax]
-       mov     eax, fs:[eax]
+       mov     eax, fs:gs:[eax]
 
        # expressions
 
index c1bbef93ab11fe4b27ca1ecdf5b465d5d90ed122..efe190e9998f76f177b34614248a4c32e6dd4c88 100644 (file)
@@ -1,20 +1,10 @@
 .*: Assembler messages:
 .*:3: Error: .*
 .*:4: Error: .*
-.*:7: Error: .*
-.*:8: Error: .*
-.*:9: Error: .*
-.*:10: Error: .*
 GAS LISTING .*
 
 
-[      ]*1[    ]+\.text
-[      ]*2[    ]+\# All the following should be illegal
-[      ]*3[    ]+movl  %ds,\(%eax\)
-[      ]*4[    ]+movl  \(%eax\),%ds
-[      ]*5[    ]+
-[      ]*6[    ]+\.intel_syntax noprefix
-[      ]*7[    ]+mov   eax, DWORD PTR fs:foobar:16
-[      ]*8[    ]+mov   eax, DWORD PTR fs:foobar:barfoo:16
-[      ]*9[    ]+mov   eax, DWORD PTR fs:ds:16
-[      ]*10[   ]+mov   eax, DWORD PTR fs:ds:cs:16
+   1 [         ]*      .text
+   2 [         ]*# All the following should be illegal
+   3 [         ]*      movl    %ds,\(%eax\)
+   4 [         ]*      movl    \(%eax\),%ds
index b23d87de33e6fc07bf419a48e91f9268f4e04127..4cc222145e8a79ae052cb42cab4a682ab5e086d1 100644 (file)
@@ -2,9 +2,3 @@
 # All the following should be illegal
        movl    %ds,(%eax)
        movl    (%eax),%ds
-
-       .intel_syntax noprefix
-       mov     eax, DWORD PTR fs:foobar:16
-       mov     eax, DWORD PTR fs:foobar:barfoo:16
-       mov     eax, DWORD PTR fs:ds:16
-       mov     eax, DWORD PTR fs:ds:cs:16
index 51deb15e55f973062605074f02a2f50a1c59472f..adef5d41d4446b8ed45fa0934c4293174a78f9f4 100644 (file)
@@ -3,22 +3,12 @@
 .*:4: Error: .*
 .*:5: Error: .*
 .*:6: Error: .*
-.*:9: Error: .*
-.*:10: Error: .*
-.*:11: Error: .*
-.*:12: Error: .*
 GAS LISTING .*
 
 
-[      ]*1[    ]+\.text
-[      ]*2[    ]+\# All the following should be illegal
-[      ]*3[    ]+movq  %ds,\(%rax\)
-[      ]*4[    ]+movl  %ds,\(%rax\)
-[      ]*5[    ]+movq  \(%rax\),%ds
-[      ]*6[    ]+movl  \(%rax\),%ds
-[      ]*7[    ]+
-[      ]*8[    ]+\.intel_syntax noprefix
-[      ]*9[    ]+mov   eax, DWORD PTR fs:foobar:16
-[      ]*10[   ]+mov   eax, DWORD PTR fs:foobar:barfoo:16
-[      ]*11[   ]+mov   eax, DWORD PTR fs:ds:16
-[      ]*12[   ]+mov   eax, DWORD PTR fs:ds:cs:16
+   1 [         ]*      .text
+   2 [         ]*# All the following should be illegal
+   3 [         ]*      movq    %ds,\(%rax\)
+   4 [         ]*      movl    %ds,\(%rax\)
+   5 [         ]*      movq    \(%rax\),%ds
+   6 [         ]*      movl    \(%rax\),%ds
index cfe46cf639fbf3d2ef877102f0bfcdf687ce3b08..bb547422364a55a9ed4472984d88b9d7586deeb0 100644 (file)
@@ -4,9 +4,3 @@
        movl    %ds,(%rax)
        movq    (%rax),%ds
        movl    (%rax),%ds
-
-       .intel_syntax noprefix
-       mov     eax, DWORD PTR fs:foobar:16
-       mov     eax, DWORD PTR fs:foobar:barfoo:16
-       mov     eax, DWORD PTR fs:ds:16
-       mov     eax, DWORD PTR fs:ds:cs:16
This page took 0.036588 seconds and 4 git commands to generate.