Generalized Constant Propagation a study in C

  • Clark Verbrugge
  • Phong Co
  • Laurie Hendren
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1060)

Abstract

Generalized Constant Propagation (GCP) statically estimates the ranges of variables throughout a program. GCP is a top-down compositional compiler analysis in the style of abstract intepretation. In this paper we present an implementation of both intraprocedural and interprocedural GCP within the context of the C language. We compare the accuracy and utility of GCP information for several versions of GCP using experimental results from an actual implementation.

References

  1. [Bou93]
    François Bourdoncle. Abstract debugging of higher-order imperative languages. In Proc. of SIGPLAN PLDI '93, pages 46–55, Albuquerque, N. Mex., Jun. 1993.Google Scholar
  2. [CC77]
    Patrick Cousot and Radhia Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction of approximations of fixpoints. In Conf. Rec. of POPL-4, pages 238–252, Los Angeles, Calif., Jan. 1977.Google Scholar
  3. [CC92]
    Patrick Cousot and Radhia Cousot. Comparing the galois connection and widening / narrowing approaches to abstract interpretation. Technical Report LIX/RR/92/09, Ecole Polytechnique Laboratoire d'Informatique, 91128 Palaiseau Cedex, France, Juin 1992.Google Scholar
  4. [CCKT86]
    David Callahan, Keith D. Cooper, Ken Kennedy, and Linda Torczon. Interprocedural constant propagation. In Proc. of the SIGPLAN '86 Symp. on Compiler Construction, pages 152–161, Palo Alto, Calif., Jun. 1986.Google Scholar
  5. [CH95]
    Paul R. Carini and Michael Hind. Flow-sensitive interprocedural constant propagation. In Proc. of SIGPLAN PLDI '95, pages 23–31, La Jolla, Calif., Jun. 1995.Google Scholar
  6. [DM81]
    Nachum Dershowitz and Zohar Manna. Inference rules for program annotation. IEEE Transactions on Software Engineering, SE-7(2):207–222, Mar. 1981.Google Scholar
  7. [EGH94]
    Maryam Emami, Rakesh Ghiya, and Laurie J. Hendren. Context-sensitive interprocedural points-to analysis in the presence of function pointers. In Proc. of SIGPLAN PLDI '94, pages 242–256, Orlando, Flor., Jun. 1994.Google Scholar
  8. [EH94]
    Ana M. Erosa and Laurie J. Hendren. Taming control flow: A structured approach to eliminating goto statements. In Proc. of the 1994 Intl. Conf. on Computer Languages, pages 229–240, Toulouse, France, May 1994.Google Scholar
  9. [GT93]
    Dan Grove and Linda Torczon. Interprocedural constant propagation: A study of jump function implementations. In Proc. of SIGPLAN PLDI '93, pages 90–99, Albuquerque, N. Mex., Jun. 1993.Google Scholar
  10. [Har77]
    William H. Harrison. Compiler analysis of the value ranges for variables. IEEE Trans. on Software Eng., 3(3):243–250, May 1977.Google Scholar
  11. [HDE+92]
    L. Hendren, C. Donawa, M. Emami, G. Gao, Justiani, and B. Sridharan. Designing the McCAT compiler based on a family of structured intermediate representations. In Proc. of the 5th Intl. Work, on Languages and Compilers for Parallel Computing, number 757 in LNCS, pages 406–420, New Haven, Conn., Aug. 1992. Springer-Verlag. Publ. in 1993.Google Scholar
  12. [HEGV93]
    Laurie J. Hendren, Maryam Emami, Rakesh Ghiya, and Clark Verbrugge. A practical context-sensitive interprocedural analysis framework for C compilers. ACAPS Tech. Memo 72, Sch. of Comp. Sci., McGill U., Montréal, Qué., Jul. 1993. In http://ftp-acaps.cs.mcgill.ca/pub/doc/memos.Google Scholar
  13. [MS93]
    Robert Metzer and Sean Stroud. Interprocedural constant propagation: An empirical study. ACM Letters on Programming Languages and Systems, 2(1–4):213–232, 1993.Google Scholar
  14. [Pat95]
    Jason R. C. Patterson. Accurate static branch prediction by value range propagation. In Proc. of SIGPLAN PLDI '95, pages 67–78, La Jolla, Calif., Jun. 1995.Google Scholar
  15. [Sri92]
    Bhama Sridharan. An analysis framework for the McCAT compiler. Master's thesis, McGill U., Montréal, Qué., Sep. 1992.Google Scholar
  16. [WZ91]
    Mark N. Wegman and F. Kenneth Zadeck. Constant propagation with conditional branches. ACM Trans. on Programming Languages and Systems, 13(2):181–210, Apr. 1991.Google Scholar

Copyright information

© Springer-Verlag 1996

Authors and Affiliations

  • Clark Verbrugge
    • 1
  • Phong Co
    • 1
  • Laurie Hendren
    • 1
  1. 1.School of Computer ScienceMcGill UniversityMontréalCanada

Personalised recommendations