Mail Archives: djgpp/1999/03/29/18:45:50
Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk> wrote in message
news:8D53104ECD0CD211AF4000A0C9D60AE3D9796F AT probe-2 DOT acclaim-euro DOT net...
> Andrew Davidson writes:
> > I'm having a neat little problem with a teeny little bit of inline
> > assembler. The line goes like this:
> > asm (
> > "call %%esi\n"
> > : "=a" (regpcaf), "=b" (regiyhl), "=c" (regixbc), "=d" (regspde)
> > : "a" (regpcaf),"b" (regiyhl), "c" (regixbc), "d" (regspde), "S"
> > (cpuid->scratchmem), "D" (cpuid->cpumem)
> > : "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi"
> > );
>
> gcc is not very good (read: incapable) of dealing with situations
> where there are no free registers. In this case you are using up all
> the general purpose regs, and after it has loaded the first five, it
> only has one free to use in whatever calculations it needs to load
> that last value. That is probably possible, but the optimiser isn't
> geared towards this situation, so it gets confused.
>
> Compiling with -fomit-frame-pointer might help, since it could then
> use %ebp as another working register. Otherwise, you'll just have
> to rewrite your code to leave at least one register free.
>
Thanks for that, it seems to be working now. Incidentally, as it's compiled
with omit-frame-pointer can I use %ebp within my code without risking
crashing anything? (Assuming I put it in the clobber list?). I could really
do with an extra work register...
Andrew
- Raw text -