From: "Chris Purdie" <1 AT 1 DOT com> Newsgroups: comp.os.msdos.djgpp References: <935854169 DOT 868702 AT rodelo DOT cyberverse DOT com> Subject: Re: Problem compiling cpu.c in Allegro... Lines: 108 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 Organization: Cyberverse, Inc. Message-ID: <935868662.895145@rodelo.cyberverse.com> Cache-Post-Path: rodelo.cyberverse.com!unknown AT 209 DOT 151 DOT 230 DOT 196 X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Date: Sat, 28 Aug 1999 12:26:16 -0700 NNTP-Posting-Host: 209.151.224.37 X-Complaints-To: abuse AT verio DOT net X-Trace: nuq-read.news.verio.net 935868663 209.151.224.37 (Sat, 28 Aug 1999 19:31:03 GMT) NNTP-Posting-Date: Sat, 28 Aug 1999 19:31:03 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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 > >