no noalias not negligible - a difference between C and Fortran - long

Henry Spencer henry at utzoo.uucp
Mon May 23 10:03:35 AEST 1988


Everyone agrees that the problem needs attention; unfortunately, there is
no well-proven solution to it for C, and thus it is inappropriate to try
to deal with it as part of standardization of the existing language.

> ...  Perhaps what will happen is that high-performance
> C compilers will adopt the questionable CDC/Cray Fortran practice 
> of providing "unsafe" optimization levels that, for instance,
> assume all pointers are unaliased.

High-performance compilers will have to have *SOME WAY* to find out about
aliasing or lack thereof.  The obvious way is to have some sort of magic
cookie in the source to selectively indicate when promises are made about
aliasing.  A compile-time option that covers a whole file isn't really a
good idea, considering how pervasive pointers are in C and how common
aliasing is.  The obvious type of cookie is #pragma.  (It is claimed,
probably correctly, that #pragma technically is not allowed to change
the semantics of the language, but that's not the way it will happen
in the real world.)
-- 
NASA is to spaceflight as            |  Henry Spencer @ U of Toronto Zoology
the Post Office is to mail.          | {ihnp4,decvax,uunet!mnetor}!utzoo!henry



More information about the Comp.lang.c mailing list