skip to main content
10.1145/301618.301647acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free access

Pointer analysis for programs with structures and casting

Published: 01 May 1999 Publication History

Abstract

Type casting allows a program to access an object as if it had a type different from its declared type. This complicates the design of a pointer-analysis algorithm that treats structure fields as separate objects; therefore, some previous pointer-analysis algorithms "collapse" a structure into a single variable. The disadvantage of this approach is that it can lead to very imprecise points-to information. Other algorithms treat each field as a separate object based on its offset and size. While this approach leads to more precise results, the results are not portable because the memory layout of structures is implementation dependent.This paper first describes the complications introduced by type casting, then presents a tunable pointer-analysis framework for handling structures in the presence of casting. Different instances of this framework produce algorithms with different levels of precision, portability, and efficiency. Experimental results from running our implementations of four instances of this framework show that (i) it is important to distinguish fields of structures in pointer analysis, but (ii) making conservative approximations when casting is involved usually does not cost much in terms of time, space, or the precision of the results.

References

[1]
T. Austin, S. Breach, and G. Sohi. Efficient detection of all pointer and array access errors. In A CM SIGPLAN '9~ Conference on Programming Language Design and Implementation, pages 290-301, June 1994.
[2]
L.O. Andersen. Program Analysis and Specialization for the C Programming Language. P hD thesis, DiKU, University of Copenhagen, May 1994. (DIKU report 94/19).
[3]
M. Burke, P. Carini, J.-D. Choi, and M. Hind. Flow-insensitive interprocedural alias analysis in the presence of pointers. In K. Pingali, U. Banerjee, D. Gelernter, A. Nicolau, and D. Padua, editors, Language and Compilers for Parallel Computing, 7th International Workshop, LNCS 892, pages 234-250. Springer- Verlag, August 1994.
[4]
J. Choi, M. Burke, and P. Carini. Efficient flow-sensitive interporcedural computation of pointer-induced aliases and side effects. In A CM Symposium on Principles of Programming Languages, pages 232-245, January 1993.
[5]
M. Emami, R. Ghiya, and L. Hendren. Contextsensitive interprocedural points-to analysis in the presence of function pointers. In A CM SIG- PLAN '9~ Conference on Programming Language Design and Implementation, pages 242- 256, June 1994.
[6]
ISO/IEC. International Standard ISO/IEC 9899, Programming Languages- C. 1st Ed. 1990.
[7]
W. Landi, B. Ryder, and S. Zhang. Interprocedural modification side effect analysis with pointer aliasing. In A CM SIGPLAN '93 Conference on Programming Language Design and Implementation, pages 56-67, June 1993.
[8]
E. Ruf. Context-insensitive alias analysis reconsidered. In A CM SIGPLAN '95 Conference on Programming Language Design and implementation, pages 13-22, June 1995.
[9]
B. Ryder. personal communication, September 1998.
[10]
M. Shapiro and S. Horwitz. The effects of the precision of pointer analysis. In ~th International Symposium on Static Analysis, LNCS 1302. Springer-Verlag, September 1997.
[11]
M. Shapiro and S. Horwitz. Fast and accurate flow-insensitive points-to analysis. In A CM Symposium on Principles of Programming Languages, January 1997.
[12]
P. Stocks, B. Ryder, W. Landi, and S. Zhang. Comparing flow and context sensitivity on the modification-side-effects problem. In International Symposium on Software Testing and Analysis, pages 21-31, March 1998.
[13]
B. Steensgaard. Points-to analysis by type inference of programs with structures and unions. In International Conference on Compiler Construction, April 1996.
[14]
B. Steensgaard. Points-to analysis in almost linear time. In A CM Symposium on Principles o/ Programming Languages, pages 32-41, January 1996.
[15]
P. Tonella. Points-to analysis for program understanding. In Proceedings of the International Workshop on Program Comprehension, May 1997.
[16]
R. Wilson, R. French, C. Wilson, S. Amarasinghe, J. Anderson, S. Tjiang, S. Liao, C. Tseng, M. Hall, M. Lain, and J. Hennessy. SUIF: An infrastructure for research on parallelizing and optimizing compilers. In A CM SIGPLAN Notices, volume 29(12), pages 31- 37, December 1994.
[17]
R. Wilson and M. Lain. Efficient contextsensitive pointer analysis for C programs. In A CM SIGPLAN '95 Conference on Programming Language Design and Implementation, pages 1-12, June 1995.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '99: Proceedings of the ACM SIGPLAN 1999 conference on Programming language design and implementation
May 1999
304 pages
ISBN:1581130945
DOI:10.1145/301618
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 1999

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Conference

PLDI99

Acceptance Rates

PLDI '99 Paper Acceptance Rate 26 of 130 submissions, 20%;
Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)120
  • Downloads (Last 6 weeks)14
Reflects downloads up to 03 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media