Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!shelby!portia.stanford.edu!elaine24.stanford.edu!dhinds From: dhinds@elaine24.stanford.edu (David Hinds) Newsgroups: comp.lang.c Subject: Re: Whither _noalias_? Message-ID: <1991Feb8.211734.22306@portia.Stanford.EDU> Date: 8 Feb 91 21:17:34 GMT References: <1991Feb7.050917.24550@zoo.toronto.edu> Sender: news@portia.Stanford.EDU (Mr News) Organization: Stanford University - AIR Lines: 28 In article <1991Feb7.050917.24550@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article enag@ifi.uio.no (Erik Naggum) writes: >>I haven't seen any mention of "noalias" in ANSI C compilers I've >>talked to, so I just wonder if I wasn't alone in not really grasping >>what noalias was good for and why its introduction was required. > >Its purpose was to let the programmer tell the compiler that arguments to >a function were not aliases for each other, for the sake of optimization >on vector machines and the like. The optimizing people really cared about >it. Unfortunately, (a) the description was exceedingly cryptic and repeated >efforts failed to produce one that "did the right thing", (b) it spread >slimy tentacles everywhere in the standard libraries, and (c) it was >introduced far too late in the development of the standard. The result >was a firestorm of protest, including a declaration of war :-) from Dennis >Ritchie and formal threats to vote against ratification of ANSI C as ISO C. >The committee backed down and removed it. That's a shame. Pointers do allow the writing of more efficient code in some cases, but I hate having to tune really time-critical code by introducing lots of dummy variables to hold pointer dereferences, because the compiler can't optimize them worth a damn. Was it really that hard to come up with a clear and useful definition of "noalias", or was it just a result of committee politics fouling it up? Was the proposal to just have "noalias" apply to function parameters? It would seem to be much more useful if it could be used on any pointer variable. -David Hinds dhinds@cb-iris.stanford.edu