delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/29/18:45:50

From: "Andrew Davidson" <andrew AT lemure DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Fixed or forbidden register spilled error
Date: Tue, 30 Mar 1999 00:40:49 +0100
Organization: Customer of Planet Online
Lines: 34
Message-ID: <7dp31h$g80$1@news4.svr.pol.co.uk>
References: <8D53104ECD0CD211AF4000A0C9D60AE3D9796F AT probe-2 DOT acclaim-euro DOT net>
NNTP-Posting-Host: modem-49.cerium.dialup.pol.co.uk
X-Trace: news4.svr.pol.co.uk 922750833 16640 62.136.28.177 (29 Mar 1999 23:40:33 GMT)
NNTP-Posting-Date: 29 Mar 1999 23:40:33 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


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