From: buers AT gmx DOT de (Dieter Buerssner) Newsgroups: comp.os.msdos.djgpp Subject: Re: Re: NEED HELP WITH GRX Date: 18 Mar 2000 10:53:46 GMT Lines: 35 Message-ID: <8avn7q$49908$1@fu-berlin.de> References: <38D0C9F8 DOT 40BECC63 AT ujf-grenoble DOT fr> <8aqsuf$42fh4$1 AT fu-berlin DOT de> <38D16047 DOT 3C9F9A95 AT ujf-grenoble DOT fr> NNTP-Posting-Host: pec-45-38.tnt3.s2.uunet.de (149.225.45.38) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 953376826 4498440 149.225.45.38 (16 [17104]) X-Posting-Agent: Hamster/1.3.13.0 User-Agent: Xnews/03.02.04 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Robert Bruce wrote: >I tried the patches also and ran into the same problem you are seeing, >the solution was obvious after the fact. If the assembler says it >shouldn't be there then just remove it. The cause of the problem has >to do with the assembler/compiler automagically tagging the register >as dirty and it apparently resents us trying to tell it what to do in >cases like that. > >here is what the working version on my system looks like. > : "=r" ((void *)s), "=r" ((void *)d), "=r" ((int)w)/*,"=cx" >(dummy)*/ > : "0" ((void *)s), "1" ((void *)d), "2" ((int)w), "c" >((int)shift) > : "ax" > >The "c" also refers to the cx/ecx register so that is all the notice >the compiler wants or needs. This may work by accident only. You are lying to the compiler. It is free to assume that register ecx is kept const, so when the variable shift is used again, the compiler can assume, that it is still unchanged in the register. But the code destroys the cx register. This was indicated by the 'old' method to put the register on the clobbered list. But this is forbidden for input registers in gcc 2.95. So the workaround with dummy variables in the output list. Also note, that you just cannot comment in and out /*,"=cx" (dummmy) */ This needs renumbering of the registers in the asm code. With ,"=c" (dummy), the "c" ((int)shift) should read "3" (shift). Regards, Dieter