Whither _noalias_?

David Hinds dhinds at elaine24.stanford.edu
Sat Feb 9 08:17:34 AEST 1991


In article <1991Feb7.050917.24550 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>In article <ENAG.91Jan14003710 at svarte.ifi.uio.no> enag at 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 at cb-iris.stanford.edu



More information about the Comp.lang.c mailing list