Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site hcrvx1.UUCP Path: utzoo!hcradm!hcrvx1!hugh From: hugh@hcrvx1.UUCP (Hugh Redelmeier) Newsgroups: net.lang.c Subject: Re: C Compiler bug (a mutant strain) Message-ID: <1380@hcrvx1.UUCP> Date: Thu, 24-Jul-86 11:34:25 EDT Article-I.D.: hcrvx1.1380 Posted: Thu Jul 24 11:34:25 1986 Date-Received: Fri, 25-Jul-86 05:23:59 EDT References: <501@bunny.UUCP> <6224@allegra.UUCP> Reply-To: hugh@hcrvx1.UUCP (Hugh Redelmeier) Organization: Human Computing Resources, Toronto Lines: 14 In article <6224@allegra.UUCP> mp@allegra.UUCP (Mark Plotnick) writes: >The i /= f and i *= f bugs occur in the 4.3bsd-beta and 4.2bsd >compilers... The 4.3bsd and System V VAX compilers do the right thing. Well, not so fast. Many System V compilers (I don't know about 4.3BSD -- we haven't gotten it yet!) have a bug in the fix to this bug! Try "*p++ /= f;" where p is "int *": the ++ gets done twice. In fact, any side-effect on the left-hand-side would be done twice. Allen McIntosh of HCR has fixed this (with some effort) as part of our optimizer project (we produce a portable optimizer that fits into PCC and f77). Hugh Redelmeier (416) 922-1937 {utzoo, ihnp4, decvax}!hcr!hugh