Skip to contentSkip to conversation

"fixed or forbidden register 0 (ax) was spilled for class AREG"

DISCUSSION Andre Majorel 1 participant 1 message Dec 20, 2002

lore
Share & tools
lore
#0 lore raw

Greetings gentlemen. Trying to compile Linux-hexen 0.6.0 with GCC 2.95.4, I got "Invalid `asm' statement" errors. The errors occur in a routine that seems to multiply a 16.16 fixed point number by a integer. Here's a fragment that triggers the error :

   1  typedef int fixed_t;
   2  
   3  int foo (void)
   4  {
   5    int f_w;
   6    fixed_t m_w;
   7    fixed_t scale_ftom;
   8  
   9    m_w =
  10    (
  11      {
  12        int __value, __fb = (scale_ftom);
  13        __asm__("imul %%ebx; shrd $16,%%edx,%%eax"
  14                : "=a" (__value)
  15                : "a" (f_w<<16), "b" (__fb)
  16                : "eax", "edx");
  17        __value;
  18      }
  19    );
  20  }
  $ gcc badasm.c
  badasm.c: In function `foo':
  badasm.c:16: Invalid `asm' statement:
  badasm.c:16: fixed or forbidden register 0 (ax) was spilled for class AREG.

This code used to compile before GCC was upgraded. I'd appreciate any hints on how to fix it.

Signature · 2 lines
André Majorel <[email protected]>
http://www.teaser.fr/~amajorel/