Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c Subject: Re: C compiler test Message-ID: <3153@utcsri.UUCP> Date: Wed, 23-Jul-86 14:46:39 EDT Article-I.D.: utcsri.3153 Posted: Wed Jul 23 14:46:39 1986 Date-Received: Wed, 23-Jul-86 15:23:27 EDT References: <2477@brl-smoke.ARPA> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 29 Summary: In article <2477@brl-smoke.ARPA> ucsch.pravda@ucb-vax.ARPA writes: > >On our VAX 11/750 running 4.2bsd I got the incorrect 3 and 4 >both normal and optimized. > >Maybe you see something in this (I'm no assembler wiz)? : ( Comments mine:) >L16: .double 0d2.5e+00 > .text > cvtld -4(fp),r0 ; r0 = (double)i > divd2 L16,r0 ; r0 = r0/2.5 ( double divide ) > cvtdl r0,r0 ; r0 = (int)r0 > movl r0,-4(fp) ; i = r0 : >L19: .double 0d2.5e+00 > .text > cvtdl L19,r0 ; r0 = (int)2.5 ( i.e. r=2 ) > divl2 r0,-4(fp) ; i=i/r0 ( integer divide ) So i /= 2.5 is incorrectly treated as i /= (int)2.5. ( This here VAX running 4.2BSD produces essentially the same code for both and says 3,3). -- "You'll need more than a Tylenol if you don't tell me where my father is!" - The Ice Pirates ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg