C Compiler for Unix V.2 Motorola 68020 Port
Gary Sarff
gsarff at sarek.UUCP
Sun Feb 18 03:19:19 AEST 1990
In article <1990Feb10.035315.1140 at esegue.segue.boston.ma.us>, ray at 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?
More information about the Comp.lang.c
mailing list