This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Wrong inline assembler code generation (IMulL)


On May 12, 2000, "Skvarenina Peter - 5ZA51/9" <skvaren@fred.fri.utc.sk> wrote:

>                 : "=a" (Result), "=d" (temp)

> IMulL %ESI, %EAX          // This will change EDX -> EDX:EAX = result of IMUL
> IDiv  %EDX, %EAX          // Wrong divide

> Did I something wrong ?

Yup.  Mark the `d' output operand as earlyclobber (`&') so that it
won't be used for input operands.

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]