Mail Archives: djgpp/1999/08/28/16:20:16
Answering my own question here, for anyone who's interested. Andris Pavenis
mentioned something interesting in an earlier post about this (AMD and
allegro possible?):
>About this problem. Allegro-3.11 (and not only this package) contains
>invalid inline assembler instructions (earlier gcc versions before
>gcc-2.95 silently ignored this problem)
>
>See:
>http://gcc.gnu.org/faq.html#asmclobber
>for more details.
Following the instructions about input clobbering at the above URL, I
changed the five offending routines in my cpu.c from:
static int is_XXXXX()
{
int result;
asm (
.
.
.
.
: "=a" (result)
:
: "eax", "ecx", "memory"
);
return result;
}
TO:
static int is_XXXXX()
{
int result=0;
int dummy;
asm (
.
.
.
.
: "=a" (dummy)
: "0" (result)
: "eax", "ecx", "memory"
);
return result;
}
And it compiled with no errors!
Not sure if the routines are now "fixed", but the above should at least help
anyone else with this problem to get going for now.
Chris.
Chris Purdie <1 AT 1 DOT com> wrote in message
news:935854169 DOT 868702 AT rodelo DOT cyberverse DOT com...
> I downloaded GCC 2.95 and Allegro 3.11 from ftp.cdrom.com, and am having a
> nightmare trying to build the Allegro objects.
>
> I have the path set and the environment variable set, and I believe that
gcc
> is installed properly, but when I run 'make' in the Allegro directory, it
> fails on cpu.o with the following errors:
>
>
gcc -I. -Isrc -Iobj/djgpp -Wall -Wno-unused -m486 -O3 -ffast-math -fomit-fra
> me-p
> ointer -o obj/djgpp/cpu.o -c src/cpu.c
> src/cpu.c: In function `check_cpu':
> src/cpu.c:276: Invalid `asm' statement:
> src/cpu.c:276: fixed or forbidden register 0 (ax) was spilled for class
> AREG.
> src/cpu.c:155: Invalid `asm' statement:
> src/cpu.c:155: fixed or forbidden register 0 (ax) was spilled for class
> AREG.
> src/cpu.c:124: Invalid `asm' statement:
> src/cpu.c:124: fixed or forbidden register 0 (ax) was spilled for class
> AREG.
> src/cpu.c:64: Invalid `asm' statement:
> src/cpu.c:64: fixed or forbidden register 0 (ax) was spilled for class
AREG.
> src/cpu.c:155: Invalid `asm' statement:
> src/cpu.c:155: fixed or forbidden register 0 (ax) was spilled for class
> AREG.
> make.exe: *** [obj/djgpp/cpu.o] Error 1
>
> If I remove the assembly routines from cpu.c and rerun 'make', everything
> compiles fine, but obviously this is not an ideal solution! :o)
>
> Is this related to what processor I'm running (a Pentium II 450)? Should
I
> be using PGCC? Is it simply a djgpp configuration issue?
>
> Any pointers would be greatly appreciated.
>
>
> Chris
>
>
- Raw text -