www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/29/05:55:52

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3D9796F@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Fixed or forbidden register spilled error
Date: Mon, 29 Mar 1999 11:54:01 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019