https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89502

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to H.J. Lu from comment #0)
> x.s: Assembler messages:
> x.s:11: Error: can't encode segment `%fs' with 32-bit address
> x.s:18: Error: can't encode segment `%fs' with 32-bit address

Is this some new warning, since

GNU assembler version 2.31.1-17.fc29

happily assembles 

        movl    %fs:(%edx), %ecx

to:

   8:   64 67 8b 0a             mov    %fs:(%edx),%ecx

Anyway, the following patch should fix this issue:

--cut here--
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index e77653d66a4..67872e1c15d 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -18542,6 +18542,10 @@ ix86_print_operand_address_as (FILE *file, rtx addr,

   if (!ADDR_SPACE_GENERIC_P (as))
     {
+      /* We can't have 0x67 prefix with segment override.  */
+      if (TARGET_64BIT)
+       code = 'q';
+
       if (ASSEMBLER_DIALECT == ASM_ATT)
        putc ('%', file);

--cut here--

Reply via email to