Method for determining the side effects of procedure calls [Thesis]
- 1 August 1978
- report
- Published by Office of Scientific and Technical Information (OSTI)
Abstract
The presence of procedures and procedure calls in a programming language can give rise to various kinds of side effects. Calling a procedure can cause unexpected references and modifications to variables (variable side effects) and nonobvious transfers of control (exit side effects). In addition, procedure calls and parameter-passing mechanisms can cause several different variable names to refer to the same location; thus, they become aliases. This situation in turn causes all of these variables to be accessed whenever one of the variables is modified or referenced. Determining the aliases of variables and the exit and variable side effects of procedure calls is important for a number of purposes including the generation of optimized code for high-level languages. This paper presents a method of determining exit and variable side effects and gives an algorithm for determining the aliases of variables. The principal advantage over previous methods is that only one pass over a program is used to gather the information needed to compute certain variable side effects precisely, even in the presence of recursion and reference parameters. In addition, these methods can be extended to cover programs with a number of features including procedure and label parameters. An abstract model ofmore » block-structured programs is developed and used to prove that the methods given yield approximations which are safe for use in program optimization and, for certain side effects, are at least as precise as those given by any previous method. The implementation of these methods is discussed in general, and a particular implementation for the programming language PASCAL is described. Finally, the results of an empirical study of side effects and aliases in a collection of PASCAL programs are presented. 42 figures, 3 tables. « lessKeywords
This publication has 0 references indexed in Scilit: