This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Inline ASM problem
- To: help-gcc at gnu dot org
- Subject: Inline ASM problem
- From: "F.R.M.Barnes" <frmb2 at ukc dot ac dot uk>
- Date: 7 Jan 2000 21:27:36 GMT
- Newsgroups: gnu.gcc.help
- Organization: University of Kent at Canterbury
- Xref: wodc7nx0 gnu.gcc.help:2398
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/