Noalias trivia question

Peter J Desnoyers peter at athena.mit.edu
Fri May 27 02:12:32 AEST 1988


In article <14522 at brl-adm.ARPA> dsill at nswc-oas.arpa (Dave Sill) writes:
>From: "T. William Wells" <bill at proxftl.uucp>
>>Noalias
>>solves a problem which CANNOT be solved by an optimizer (yes,
>>this is another problem which can be shown to be equivalent to a
>>halting problem).
>
>That's a new one on me.  I'd like to see that reduction.  

Try add_vector( foo(x), bar(y), n). It looks uncommonly like the 
halting problem to me.

>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. 

You forget that programmers use often faulty and heuristic algorithms,
and then debug their code. A compiler that generates bugs as often as
I do (or any other programmer) would be worthless.

Not only that, programmers do not use an algorithm to determine if a
variable is noalias/volatile/whatever. They use coding practices to
generate code that does not disobey such constraints. Then they debug
their code to remove any unintentional aliasing or whatever. These are
both procedures far out of the domain of any compiler.

				Peter Desnoyers
				peter at athena.mit.edu



More information about the Comp.lang.c mailing list