smart compilers

jbn at wdl1.UUCP jbn at wdl1.UUCP
Wed Jan 16 07:42:10 AEST 1985


     Trouble comes when the language semantics are so loose that efficient
code generation is impossible without making assumptions that are true almost
all of the time, but not all the time.  In C, for example, there is an
assumption that pointers point to memory, not non-memory objects such as
devices.  In the Berkeley VAX compiler, code sequences involving shifting
and masking may generate VAX field-extract functions.  But the VAX does not
implement these instructions for UNIBUS space, so this is an optimization
not always valid.
     Assuming that the ``volatile'' keyword is a data attribute 
(i.e., one writes "static volatile char device_input_register") this
is an appropriate way to deal with the problem.



More information about the Comp.unix.wizards mailing list