Of course, ultimately it would be nice if programmers were given the
language constructs needed to express exactly what they mean. Then
they could stop lying and playing tricks. That way experienced
programmers and library implementors could provide the kind of
information needed for compilers. restrict is a step in the right
direction... but, as I said before, much work needs to be done to
generalize it for use in modern codes (that use abstractions such as
iterators).
Arch Robison writes:
> > I know of at least one practicing FORTRAN programmer who quite
> > deliberately "lied" to the compiler to achieve a higher degree of
> > optimization. The same array was passed to a subroutine through two
>
> Neat example! This is one situation where the C "restrict" is an improvement
> on the FORTRAN semantics. With "restrict", one can create local multiple
> restricted pointers to the same object, and use them, as long as no dependences
> are introduced between the operations using different pointers.
>
> Of course, whether the compiler uses "restrict" in this situation
> depends upon how much you pay your compiler company :-)
>
> Arch D. Robison Kuck & Associates Inc.
> robison@kai.com 1906 Fox Drive
> 217-356-2288 ext. 56 Champaign IL 61820
> Lead Developer for KAI C++ http://www.kai.com/C_plus_plus/index.html
>
> --------------------- Object Oriented Numerics List --------------------------
> * To subscribe/unsubscribe: use the handy web form at
> http://oonumerics.org/oon/
> * If this doesn't work, please send a note to owner-oon-list@oonumerics.org
>
--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:11 EST