Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watcgl.UUCP Path: utzoo!watmath!watcgl!dmmartindale From: dmmartindale@watcgl.UUCP (Dave Martindale) Newsgroups: net.bugs.4bsd Subject: Re: (more) missed optimizations in pcc Message-ID: <515@watcgl.UUCP> Date: Wed, 21-Nov-84 00:04:34 EST Article-I.D.: watcgl.515 Posted: Wed Nov 21 00:04:34 1984 Date-Received: Wed, 21-Nov-84 01:40:43 EST References: <1214@umcp-cs.UUCP> Distribution: net Organization: U of Waterloo, Ontario Lines: 13 > Index: lib/pcc/local.c 4.2 Fix > > Description: > The machine dependent expression optimizer doesn't handle > "%" or "%=" by the constants which are powers of two. These > can be done more simply as "&" or "&=". But "fixing" this gives you an answer that is different from what you would have gotten had you done the divide/multiply/subtract in cases where the "dividend" is negative. For example, if the variable "i" contains the value -7 and "j" contains "4", then i%j is -3 while i%4 is 1 (with your optimization). Are you sure you want to introduce an inconsistency like this? I don't like it.