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.
Research supported in part by an NSERC Graduate Fellowship and FCAR.
Research supported in part by NSERC and FCAR
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
François Bourdoncle. Abstract debugging of higher-order imperative languages. In Proc. of SIGPLAN PLDI '93, pages 46–55, Albuquerque, N. Mex., Jun. 1993.
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.
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.
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.
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.
Nachum Dershowitz and Zohar Manna. Inference rules for program annotation. IEEE Transactions on Software Engineering, SE-7(2):207–222, Mar. 1981.
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.
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.
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.
William H. Harrison. Compiler analysis of the value ranges for variables. IEEE Trans. on Software Eng., 3(3):243–250, May 1977.
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.
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.
Robert Metzer and Sean Stroud. Interprocedural constant propagation: An empirical study. ACM Letters on Programming Languages and Systems, 2(1–4):213–232, 1993.
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.
Bhama Sridharan. An analysis framework for the McCAT compiler. Master's thesis, McGill U., Montréal, Qué., Sep. 1992.
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.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Verbrugge, C., Co, P., Hendren, L. (1996). Generalized Constant Propagation a study in C. 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_54
Download citation
DOI: https://doi.org/10.1007/3-540-61053-7_54
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