Abstract
We present an interprocedural flow-insensitive points-to analysis algorithm based on monomorphic type inference. The source language model the important features of C including pointers, pointer arithmetic, pointers to functions, structured objects, and unions. The algorithm is based on a non-standard type system where types represent nodes and edges in a storage shape graph.
This work is an extension of previous work on performing points-to analysis of C programs in almost linear time. This work makes three new contributions. The first is an extension of a type system for describing storage shape graphs to include objects with internal structure. The second is a constraint system that can deal with arbitrary use of pointers and which incorporates a two-tier domain of pointer offsets to improve the results of the analysis. The third is an efficient inference algorithm for the constraint system, leading to an algorithm that has close to linear time and space performance in practice.
Chapter PDF
Similar content being viewed by others
Keywords
References
American National Standards Institute, Inc. Programming language —C, December 1989.
Lars Ole Andersen. Program Analysis and Specialization for the. C Programming Language. PhD thesis, Department of Computer Science, University of Copenhagen, May 1994.
Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers—Principles, Techniques, and Tools. Addison-Wesley, 1986.
Michael Burke, Paul Carini, Jong-Deok Choi, and Michael Hind. Flow-insensitive interprocedural alias analysis in the presence of pointers. In Proceedings from the 7th International Workshop on Languages and Compilers for Parallel Computing, volume 892 of Lecture Notes in Computer Science, pages 234–250. Springer-Verlag, 1995. Extended version published as Research Report RC 19546, IBM T.J. Watson Research Center, September 1994.
Jong-Deok Choi, Michael Burke, and Paul Carini. Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In Proceedings of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 232–245, January 1993.
William Clinger and Jonathan Rees (editors). Revised4 report on the algorithmic language Scheme, November 1991.
David R. Chase, Mark Wegman, and F. Kenneth Zadeck. Analysis of pointers and structures. In Proceedings of the SIGPLAN '90 Conference on Programming Language Design and Implementation, pages 296–310, June 1990.
Maryam Emami, Rakesh Ghiya, and Laurie J. Hendren. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In SIGPLAN'94: Conference on Programming Language Design and Implementation, pages 242–256, June 20–24 1994.
Fritz Henglein. Efficient type inference for higher-order binding-time analysis. In Functional Programming and Computer Architecture, pages 448–472, 1991.
Brian W. Kernighan and Dennis M. Ritchie. The C Programming Language, Second edition. Prentice Hall, 1988.
William Landi. Almost linear time points-to analyses. Personal communication at POPL'95, January 1995.
William Landi and Barbara G. Ryder. A safe approximate algorithm for interprocedural pointer aliasing. In Proceedings of the SIGPLAN '92 Conference on Programming Language Design and Implementation, pages 235–248, June 1992.
William A. Landi, Barbara G. Ryder, and Sean Zhang. Interprocedural modification side effect analysis with pointer aliasing. In Proceedings of the SIGPLAN '93 Conference on Programming Language Design and Implementation, pages 56–67, June 1993.
David Morgenthaler. Poster presentation at PLDI'95, June 1995.
Robert O'Callahan and Daniel Jackson. Detecting shared representations using type inference. Technical Report CMU-CS-95-202, School of Computer Science, Carnegie Mellon University, September 1995.
Erik Ruf. Context-insensitive alias analysis reconsidered. In SIGPLAN'95 Conference on Programming Language Design and Implementation, pages 13–22, June 1995.
Bjarne Steensgaard. Points-to analysis in almost linear time. Technical Report MSR-TR-95-08, Microsoft Research, March 1995.
Bjarne Steensgaard. Points-to analysis in almost linear time. In Proceedings 23rd SIGPLAN-SIGACT Symposium on Principles of Programming Languages, January 1996.
Robert E. Tarjan. Data structures and network flow algorithms. In Regional Conference Series in Applied Mathematics, volume CMBS 44. SIAM, 1983.
Daniel Weise, Roger F. Crew, Michael Ernst, and Bjarne Steensgaard. Value dependence graphs: Representation without taxation. In Proceedings 21st SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 297–310, January 1994.
Robert P. Wilson and Monica S. Lam. Efficient context-sensitive pointer analysis for C programs. In SIGPLAN'95 Conference on Programming Language Design and Implementation, pages 1–12, June 1995.
Sean Zhang. Poster presentation at PLDI'95, June 1995.
Author information
Authors and Affiliations
Corresponding author
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Steensgaard, B. (1996). Points-to analysis by type inference of programs with structures and unions. In: Gyimóthy, T. (eds) Compiler Construction. CC 1996. Lecture Notes in Computer Science, vol 1060. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61053-7_58
Download citation
DOI: https://doi.org/10.1007/3-540-61053-7_58
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61053-3
Online ISBN: 978-3-540-49939-8
eBook Packages: Springer Book Archive