Noalias trivia question

Karl Heuer karl at haddock.ISC.COM
Wed May 25 10:51:13 AEST 1988


In article <14522 at brl-adm.ARPA> dsill at nswc-oas.arpa (Dave Sill) writes:
>[<bill at proxftl.uucp> (T. William Wells) says that the general aliasing
>problem is unsolvable]
>
>You are implying that programmers can solve unsolvable problems but that
>programs cannot, which is simply not true.  The algorithm the programmer
>applies to determine when "noalias" can be used could be used by an
>optimizer.

The programmer has more information.  In hand-compiling the memcpy routine, I
can look at the functional specification and know that it will never be
legally called with overlapping arrays.  The corresponding way for the
compiler to have this information is via a keyword or #pragma or equivalent
which is attached to the memcpy source code.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list