From mboxrd@z Thu Jan 1 00:00:00 1970 From: "F.R.M.Barnes" To: help-gcc@gnu.org Subject: Inline ASM problem Date: Fri, 07 Jan 2000 16:49:00 -0000 Message-id: <855lo8$fnh$1@spruce.ukc.ac.uk> X-SW-Source: 2000-01/msg00105.html Hi, While waiting for RMS's book on gcc 2.95 to appear, I'm having a small problem with inline ASM. I have the following macro: #define JmpBuf_Set(JMPBUF)\ ({\ int result;\ int aresult;\ JmpBuf* _the_jmp_buf = JMPBUF;\ asm volatile ("fsave 36(%1)\n\t"\ "movl %%esp,(%1)\n\t"\ "movl %%ebp,4(%1)\n\t"\ "movl %%eax,12(%1)\n\t"\ "movl %%ebx,16(%1)\n\t"\ "movl %%ecx,20(%1)\n\t"\ "movl %%edx,24(%1)\n\t"\ "movl %%esi,28(%1)\n\t"\ "movl %%edi,32(%1)\n\t"\ "fwait\n\t"\ "movl $0f,8(%1)\n\t"\ "movl $0,%0\n\t"\ "0:" : "=&a" (aresult) :\ "r" (_the_jmp_buf) :\ "cc","memory"\ );\ result = aresult;\ }) It worked with earlier versions of gcc, but doesn't want to anymore. gcc (2.95.2) barfs with: SomeFile.c:20: Invalid `asm' statement: SomeFile.c:20: fixed or forbidden register 0 (ax) was spilled for class AREG. I've tried various variations on input/output operands with little success. The clobbered bit used to include "eax" as well, but was removed to try and cure the problem (without success). Any help much appreciated. Thanks, Fred. -- Fred Barnes, PhD research student, UKC. http://teddy.xylene.com/ frmb2@ukc.ac.uk http://www.cs.ukc.ac.uk/people/rpg/frmb2/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: "F.R.M.Barnes" To: help-gcc@gnu.org Subject: Inline ASM problem Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <855lo8$fnh$1@spruce.ukc.ac.uk> X-SW-Source: 2000-q1/msg00105.html Message-ID: <20000401000000.89ROb_9mQqNNy-Gt8UlvSo5YecB3ExgrRZybu-psyic@z> Hi, While waiting for RMS's book on gcc 2.95 to appear, I'm having a small problem with inline ASM. I have the following macro: #define JmpBuf_Set(JMPBUF)\ ({\ int result;\ int aresult;\ JmpBuf* _the_jmp_buf = JMPBUF;\ asm volatile ("fsave 36(%1)\n\t"\ "movl %%esp,(%1)\n\t"\ "movl %%ebp,4(%1)\n\t"\ "movl %%eax,12(%1)\n\t"\ "movl %%ebx,16(%1)\n\t"\ "movl %%ecx,20(%1)\n\t"\ "movl %%edx,24(%1)\n\t"\ "movl %%esi,28(%1)\n\t"\ "movl %%edi,32(%1)\n\t"\ "fwait\n\t"\ "movl $0f,8(%1)\n\t"\ "movl $0,%0\n\t"\ "0:" : "=&a" (aresult) :\ "r" (_the_jmp_buf) :\ "cc","memory"\ );\ result = aresult;\ }) It worked with earlier versions of gcc, but doesn't want to anymore. gcc (2.95.2) barfs with: SomeFile.c:20: Invalid `asm' statement: SomeFile.c:20: fixed or forbidden register 0 (ax) was spilled for class AREG. I've tried various variations on input/output operands with little success. The clobbered bit used to include "eax" as well, but was removed to try and cure the problem (without success). Any help much appreciated. Thanks, Fred. -- Fred Barnes, PhD research student, UKC. http://teddy.xylene.com/ frmb2@ukc.ac.uk http://www.cs.ukc.ac.uk/people/rpg/frmb2/