skip to main content
10.1145/207110.207111acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free Access

Efficient context-sensitive pointer analysis for C programs

Published:01 June 1995Publication History

ABSTRACT

This paper proposes an efficient technique for context-sensitive pointer analysis that is applicable to real C programs. For efficiency, we summarize the effects of procedures using partial transfer functions. A partial transfer function (PTF) describes the behavior of a procedure assuming that certain alias relationships hold when it is called. We can reuse a PTF in many calling contexts as long as the aliases among the inputs to the procedure are the same. Our empirical results demonstrate that this technique is successful—a single PTF per procedure is usually sufficient to obtain completely context-sensitive results. Because many C programs use features such as type casts and pointer arithmetic to circumvent the high-level type system, our algorithm is based on a low-level representation of memory locations that safely handles all the features of C. We have implemented our algorithm in the SUIF compiler system and we show that it runs efficiently for a set of C benchmarks.

References

  1. 1.D. R. Chase, M. Wegman, and F. K. Zadeck. Analysis of Pointers and Structures. In Proceedings of the ACM SIGPLAN'90 Conference on Programming Language Design andlmplementation, pages 296-310, June 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.J.-D. Choi, M. Burke, and P. Carini. Efficient Flow- Sensitive Interprocedural Computation of Pointer- Induced Aliases and Side Effects. In Proceedings of the 20thAnnual ACM Symposium on Principles of Programming Languages, pages 232-245, Jan. 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. An Efficient Method of Computing Static Single Assignment Form. In Proceedings of the 16th Annual ACM Symposium on Principles of Programming Languages, pages 25-35, Jan. 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.A. Deutsch. Interprocedural May-Alias Analysis for Pointers: Beyond k-limiting. In Proceedings of the ACM SIGPLAN'94 Conference on Programming Language Design and implementation, pages 230-241, June 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.M. Emami. A Practical interprocedural Alias Analysis for an Optimizing/Parallelizing C Compiler. Master's thesis, School of Computer Science, McGill University, Aug. 1993.Google ScholarGoogle Scholar
  6. 6.M. Emami, R. Ghiya, and L. J. Hendren. Context- Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers. In Proceedings of the ACM SIGPLAN'94 Conference on Programming Language Design andlmplementation,pages 242-256, June 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.M.W. Hall, S. P. Amarasinghe, B. R. Murphy, and M. S. Lam. Interprocedural Analysis for Parallelization: Preliminary Results. Technical Report CSL-TR-95-665, Computer Systems Lab, Stanford University, Stanford, CA 94305-4055, Apr. 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.W. L. Harrison III. The Interprocedural Analysis and Automatic Parallelization of Scheme Programs. Lisp and Symbolic Computation, 2(3): 176-396, Oct. 1989.Google ScholarGoogle Scholar
  9. 9.L. J. Hendren. Parallelizing Programs with Recursive Data Structures. IEEE ;l)'ansactions on Parallel and Distributed Systems, 1 (1):35-47, jan. 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.F. Irigoin, P. Jouvelot, and R. Triolet. Semantical interprocedural Parallelization: An Overview of the PIPS Project. In Proceedings of the 1991 ACM International Conference on Supercomputing, pages 254-251, June 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.N. Jones and S. Muchnick. Flow Analysis and Optimization of Lisp-like Structures. In S. Muchnick and N. Jones, editors, Program Flow Analysis: Theory and Applications, pages 102-131. Prentice Hall, 1979.Google ScholarGoogle Scholar
  12. 12.W. Landi and B. G. Ryder. A Safe Approximate Algorithm for Interprocedural Pointer Aliasing. In Proceedings of the ACM SIGPLAN'92 Conference on Programming Language Design and Implementation, pages 235-248, June 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.J. R. Larus and P. N. Hilfinger. Detecting Conflicts Between Structure Accesses. In Proceedings of the ACM SIGPLAN'88 Conference on Programming Language Design and implementation, pages 21-34, June 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.T. J. Marlowe, W. A. Landi, B. G. Ryder, J. D. Choi, M. G. Burke, and P. Carini. Pointer-Induced Aliasing: A Clarification. ACM SiGPLAN Notices, 28(9):67-70, Sept. 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15.E. Ruf. Personal communication, Oct. 1994.Google ScholarGoogle Scholar
  16. 16.R.P. Wilson et al. SUIF: An Infrastructure for Research on Parallelizing and Optimizing Compilers. ACM SiG- PLAN Notices, 29(12):31-37, Dec. 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Efficient context-sensitive pointer analysis for C programs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          PLDI '95: Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation
          June 1995
          335 pages
          ISBN:0897916972
          DOI:10.1145/207110

          Copyright © 1995 ACM

          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]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 June 1995

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          PLDI '95 Paper Acceptance Rate28of105submissions,27%Overall Acceptance Rate406of2,067submissions,20%

          Upcoming Conference

          PLDI '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader