Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!jade!ucbvax!amdcad!tim From: tim@amdcad.AMD.COM (Tim Olson) Newsgroups: comp.lang.c Subject: Re: Dhrystones Message-ID: <19488@amdcad.AMD.COM> Date: Wed, 31-Dec-69 18:59:59 EST Article-I.D.: amdcad.19488 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Sun, 13-Dec-87 11:47:44 EST References: <3368@rosevax.Rosemount.COM> <5096@ccv.bbn.COM> <19425@amdcad.AMD.COM> <9613@mimsy.UUCP> <19440@amdcad.AMD.COM> <2617@watcgl.waterloo.edu> Reply-To: tim@amdcad.UUCP (Tim Olson) Organization: Advanced Micro Devices Lines: 21 Keywords: C, performance, useful In article <2617@watcgl.waterloo.edu> smvorkoetter@watmum.waterloo.edu (Stefan M. Vorkoetter) writes: | In article <19440@amdcad.AMD.COM> tim@amdcad.UUCP (Tim Olson) writes: | ) IntLoc2 = IntLoc3 / IntLoc1; | ) IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1; | ) | )The first assignment into IntLoc2 is replaced in the next expression -- | )no need to calculate it (and we take a divide out of the loop -- big win ;-) | ) | The first IntLoc2 assignment and the division must be done since the result is | used to calculate the value for the second assignment. Sorry. I noticed that neither expression generated code, and didn't notice the use of IntLoc2 in the second expression. What *really* happened is that the compiler determined that the second expression was dead code, which *then* made the first expression dead. Thanks for catching that. -- Tim Olson Advanced Micro Devices (tim@amdcad.amd.com)