volatile: a summary

Chris Torek chris at mimsy.UUCP
Tue Jun 21 12:10:19 AEST 1988


In article <761 at garth.UUCP> smryan at garth.UUCP (Steven Ryan) writes:
>(Is `perfect enough' like `barely pregnant?')

Use `good enough' if you prefer; it is a better phrasing, anyway.

>... Obviously one could write a total recursive
>predicate that partitions what can be handled by a `perfect enough' compiler
>if conservative erring is accepted. What about what cannot be handled? Is it
>deemed not worthy of optimisation?

Yes.

The real idea is that, if the compilers get it right more often than the
programmers, we (Robert Firth and I) would rather have the compilers do it.

>Property X (X=volatile or anything else) cannot be determined for these
>outcasts. Either they are not optimised or a `perfect enough' compiler
>must be given hints ....

The same logic can be used to show that whatever optimisation algorithms
you use will miss a few `outcasts'.  We already accept this.  In extreme
cases some of us resort to assembly language programming.  Others add
more algorithms---more hints, as it were.  After a while the hints become
more expensive than the lost optimisations.

(I happen to think that point is not yet reached until *after* the
volatile keyword has been added, but that the point is a mvoing target
which will eventually move to before that point.  Already `register' is
fast becoming a noise word.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list