Mail Archives: djgpp/1999/03/29/05:55:52
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.
Shawn Hargreaves.
- Raw text -