Path: utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!pasteur!ames!umd5!trantor.umd.edu!chris From: chris@trantor.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: bitwise short-circuiting Keywords: bitwise optimize open-eyes Message-ID: <2303@umd5.umd.edu> Date: 16 Feb 88 10:59:43 GMT References: <4224@june.cs.washington.edu> Sender: ris@umd5.umd.edu Reply-To: chris@trantor.umd.edu (Chris Torek) Organization: University of Maryland, College Park Lines: 30 Without further supporting evidence, I will claim that any optimiser could convert a = 0 & f(); into (void) f(), a = 0 and if (1 | g()) s1; else s2; into (void) g(); s1; (s2 may be deleted entirely iff it is not reachable via labels), and that unless the compiler can determine that f() and g() have no side effects, any further optimisation is simply wrong. If the compiler knows that f() is a pure function, e.g., static int f() { return 0; } ... a = 0 & f(); it could then delete the call. -- In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163 (hiding out on trantor.umd.edu until mimsy is reassembled in its new home) Domain: chris@mimsy.umd.edu Path: not easily reachable