Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: C optimizer Message-ID: <11782@haddock.ima.isc.com> Date: 16 Feb 89 01:45:58 GMT References: <515@larry.UUCP> <3684@arcturus> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 12 In article <3684@arcturus> evil@arcturus.UUCP (Wade Guthrie) writes: >I would expect the following optimizations: ... 3) reducing things like >intval/2 == intval >> 1 when they are faster. On most implementations these are not equivalent, unless the compiler can prove that intval >= 0. (Ah, many's the time I've wished I could declare a type `nonnegative', which would be the intersection of signed and unsigned, so the compiler could use whichever happened to be faster...) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint