Path: utzoo!attcan!uunet!wuarchive!mailrus!hellgate.utah.edu!uplherc!wicat!sarek!gsarff From: gsarff@sarek.UUCP (Gary Sarff) Newsgroups: comp.lang.c Subject: Re: C Compiler for Unix V.2 Motorola 68020 Port Message-ID: <00392@sarek.UUCP> Date: 17 Feb 90 16:19:19 GMT References: <1990Feb10.035315.1140@esegue.segue.boston.ma.us> Organization: Programmers in Exile Lines: 34 In article <1990Feb10.035315.1140@esegue.segue.boston.ma.us>, ray@ntmtka.mn.org (ray) writes: >I am having a problem compiling the following source: > >main() >{ > long x; > double y; > > x = -((long) y); >} > >The faulty generated assembler code is : > > fneg.d((S%1-12).w,%fp),%d0 > >The %d0 is obviously wrong. This should be a floating poing register. > > >Does anybody have any ideas where to start looking in the compiler code? >Please use email. > >Thanks in advance. I compiled this on my 68020 machine with no-optimization to see what it was "thinking" and got the following assembler code ;trunc2 d:-12(a6),l:d0 fintrz.d -12(a6),fp2 fmove.l fp2,d0 neg.l d0 move.l d0,-4(a6) I don't understand your question, the %d0 is not obviously wrong, "x" is _not_ a floating point variable so why should the destination be a floating point register? Am I misunderstanding you here or what?