volatile isn't necessary, but it's there

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Apr 8 22:28:10 AEST 1988


In article <19158 at think.UUCP> barmar at fafnir.think.com.UUCP (Barry Margolin) writes:
>Who says that users aren't interested in good optimization?  I recall
>that several of the advocates of volatile in this forum were from the
>user community.  They are looking forward to compilers that can do a
>good job of optimization without screwing them because of it.

It's a matter of keeping one's priorities straight.
It is much more important that an algorithm produce
the correct results than that it be maximally fast
on a particular piece of hardware.  The way this is
supposed to be achieved in C programming is for the
compiler to correctly map the abstract virtual 
machine semantics onto the hardware and for the
programmer to provide a correct recipe for the
virtual machine.  This task is made much harder if
the virtual machine semantics are complicated, for
example to support "noalias" virtual "handles" and
so forth.

When I need more speed, I normally need a LOT more
speed, so I switch to a different machine.  Small
gains from improved optimizer technology at the
expense of code reliability are not helpful.



More information about the Comp.lang.c mailing list