[PATCH] i386 math-emu fix for gcc 2.96

From: Jakub Jelinek (jakub@redhat.com)
Date: Tue May 30 2000 - 03:03:29 EST


Hi!

Using non-lvalue in asm's output expression is illegal in gcc 2.96 (and I
wonder why older gcc accepted it at all).
I wonder why a separate variable is not used for it, it does not cause any
worse code (the mov %%fs,%0 instruction is simply given some 16-bit hard
register and then copies it to memory, there is nothing which specifying the
memory already in asm could do about it (it has "r")).

--- linux/arch/i386/math-emu/get_address.c.jj Sun Sep 13 15:18:03 1998
+++ linux/arch/i386/math-emu/get_address.c Mon May 29 11:24:37 2000
@@ -155,6 +155,7 @@ static long pm_address(u_char FPU_modrm,
 {
   struct desc_struct descriptor;
   unsigned long base_address, limit, address, seg_top;
+ unsigned short selector;
 
   segment--;
 
@@ -174,12 +175,15 @@ static long pm_address(u_char FPU_modrm,
     case PREFIX_FS_-1:
       /* The cast is needed here to get gcc 2.8.0 to use a 16 bit register
          in the assembler statement. */
- __asm__("mov %%fs,%0":"=r" ((unsigned short)addr->selector));
+
+ __asm__("mov %%fs,%0":"=r" (selector));
+ addr->selector = selector;
       break;
     case PREFIX_GS_-1:
       /* The cast is needed here to get gcc 2.8.0 to use a 16 bit register
          in the assembler statement. */
- __asm__("mov %%gs,%0":"=r" ((unsigned short)addr->selector));
+ __asm__("mov %%gs,%0":"=r" (selector));
+ addr->selector = selector;
       break;
     default:
       addr->selector = PM_REG_(segment);

        Jakub

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:23 EST