Abstract
AbstractMany Pascal compilers generate incorrect code for statements. The trap that catches many implementors, whereby overflow is generated incorrectly, is explained and means for avoiding it are discussed (with attention to cost). Most common languages have a similar construct in which iteration is ‘controlled’ by a sequence of values in that a variable takes on successive values of the sequence for the several executions of the ‘body’. Often, the size step is not restricted to plus‐or‐minus one (as in Pascal) and the correctness situation cannot be characterized in such black and white terms. Typically, there is a range of behaviours that are valid and the compiler writer is able to choose a compromise between time‐space overheads and avoidance of unnecessary overflow indications; we describe the latter behaviour as robust. We present techniques for implementation appropriate to several languages and direct comments at language designers warning against both ignoring and overestimating the cost of robustly implementing iteration statements with arbitrary step size. Lastly, we criticize the design of instructions available in some machines, ostensibly to support the implementation of such sequence controlled iteration statements.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.