Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/21/84; site rlgvax.UUCP Path: utzoo!linus!decvax!decwrl!sun!qubix!ios!apple!voder!nsc!hplabs!hao!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.lang.c Subject: Re: C compiler bug (I think). Message-ID: <72@rlgvax.UUCP> Date: Fri, 24-Aug-84 20:40:26 EDT Article-I.D.: rlgvax.72 Posted: Fri Aug 24 20:40:26 1984 Date-Received: Thu, 30-Aug-84 19:08:27 EDT References: <73@ur-valhalla.UUCP> Distribution: net Organization: CCI Office Systems Group, Reston, VA Lines: 17 > Apparenly, cc compiler does not tolerate shifting unsigned values in > initialization of global variables. Trying to compile the subroutine on > the left produces the diagnostics: > > line 1: compiler error: expression causes compiler loop: try simplifying > > | int one = (((unsigned) 2) >> 1); | int ONE() | I believe you are correct, and it is a compiler bug. I remember running into similar bugs in our 68K C compiler; casts are not always dealt with correctly in expressions evaluated at compile time. Unfortunately, I don't have a fix at hand. (Some routine which, in effect, evaluates casts at compile time is either not being called or isn't recognizing the cast as something it should clean up.) Guy Harris {seismo,ihnp4,allegra}!rlgvax!guy