Mail Archives: djgpp/2000/03/18/06:50:09
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
- Raw text -