Abstract
We describe a translation validation infrastructure for the GNU C compiler. During the compilation the infrastructure compares the intermediate form of the program before and after each compiler pass and verifies the preservation of semantics. We discuss a general framework that the optimizer can use to communicate to the validator what transformations were performed. Our implementation however does not rely on help from the optimizer and it is quite successful by using instead a few heuristics to detect the transformations that take place.
The main message of this paper is that a practical translation validation infrastructure, able to check the correctness of many of the transformations performed by a realistic compiler, can be implemented with about the effort typically required to implement one compiler pass. We demonstrate this in the context of the GNU C compiler for a number of its optimizations while compiling realistic programs such as the compiler itself or the Linux kernel. We believe that the price of such an infrastructure is small considering the qualitative increase in the ability to isolate compilation errors during compiler testing and maintenance.
- ACCL91 Martin Abadi, Luca Cardelli, P.-L. Curien, and J.-J Ldvy. Explicit substitutions. Journal of Functional Programming, 1(4):375-416, October 1991.Google ScholarCross Ref
- C+97 Alessandro Cimatti et al. A provably correct embedded verifier for the certification of safety critical software. In Computer Aided Verification. 9th International Conference. Proceedings, pages 202-213. Springer-Verlag, June 1997. Google ScholarDigital Library
- CLN+00 Christopher Colby, Peter Lee, George C. Necula, Fred Blau, and Mark Plesko. A certifying compiler for Java. To appear in Programming Language Design and Implementation, PLDI'00., June 2000. Google ScholarDigital Library
- CM75 L.M. Chirica and D. F. Martin. An approach to compiler correctness. A CM SIGPLAN Notices, 10(6):96-103, June 1975. Google ScholarDigital Library
- Cyg Cygnus Solutions. DejaGnu Testing Framework. http://www, gnu. org/software / dej agnu / dej agnu. hGoogle Scholar
- Dij76 Edsger W. Dijkstra. A Discipline of Programming. Prentice-Hall, 1976. Google ScholarDigital Library
- Goe97 Wolfgang Goerigk. Towards rigorous compiler implementation verification. In Rudolf Berghammer, editor, Proc. of the 1999' Workshop on Programming Languages and Fundamentals of Programming, pages 118-126, 1997.Google Scholar
- HPR88 Susan Horowitz, Jan Prins, and Tom Reps. On the adequacy of program dependence graphs for representing programs. In Proceedings of the Fifteenth Annual A CM Symposium on the Principles of Programming Languages, pages 146-157, San Diego, CA, January 1988. Google ScholarDigital Library
- Koz98 Dexter Kozen. Efiqcient code certification. Technical Report TR 98-1661, Cornell University, January 1998. Google ScholarDigital Library
- MCG+99 Greg Morrisett, Karl Crary, Neal Glew, Dan Grossman, Richard Samuels, Frederick Smith, David Walker, Stephanie Weirich, and Steve Zdancewic. TALx86: A realistic typed assembly language. In Proceedings of the 1999 ACM SIGPLAN Workshop on Compiler Support for System Software, pages 25-35, 1999.Google Scholar
- Mic99 Microsoft Corporation. Microsoft Developer Network Library, March 1999.Google Scholar
- Moo89 J. Strother Moore. A mechanically verified language implementation. Journal of Automated Reasoning, 5(4):461-492, December 1989. Google ScholarDigital Library
- Mor73 F. Lockwood Morris. Advice on structuring compilers and proving them correct. In Proceedings of the First A CM Symposium on Principles of Programming Languages, pages 144-152, 1973. Google ScholarDigital Library
- MP67 John McCarthy and James Painter. Correctness of a compiler for arithmetic expressions. In J. T. Schwartz, editor, Proceedings of Symposia in Applied Mathematics. American Mathematical Society, 1967.Google Scholar
- Nec98 George C. Necula. Compiling with Proofs. PhD thesis, Carnegie Mellon University, September 1998. Also available as CMU-CS-98-154. Google ScholarDigital Library
- NL98 George C. Necula and Peter Lee. The design and implementation of a certifying compiler. In A CM SICPLAN'93 Conference on Programming Language Design and Implementation, pages 333- 344, June 1998. Google ScholarDigital Library
- PSS98 Amir Pnueli, M. Siegel, and Eli Singerman. Translation validation. In Bernhard Steffen, editor, Tools and Algorithms for Construction and Analysis of Systems, 4th International Conference, TACAS '93, volume LNCS 1384, pages 151-166. Springer, 1998. Google ScholarDigital Library
- Rin99 Martin Rinard. Credible compilers. Technical Report MIT/LCS/TR-776, Massachusetts Institute of Technology, December 1999. Google ScholarDigital Library
- RM99 Martin Rinard and Darko Marinov. Credible compilation. In Proceedings of the Run-Time Result Verification Workshop, July 1999.Google Scholar
- RR89 G. Ramalingam and Thomas Reps. Semantics of program representation graphs. Technical Report CS-TR-89-900, University of Wisconsin, Madison, December 1989.Google Scholar
- TMC+96 David Tarditi, J. Gregory Morrisett, Perry Cheng, Chris Stone, Robert Harper, and Peter Lee. TIL: A type-directed optimizing compiler for ML. In PLDI'96 Conference on Programming Language Design and Implementation, pages 181-192, May 1996. Google ScholarDigital Library
- WCES94 Daniel Weise, Roger F. Crew, Michael Ernst, and Bjarne Steensgaard. Value dependence graphs: representation without taxation. In Proceedings of POPL '954, 21st A CM SICPLAN- SICA CT Symposium on Principles of Programming Languages, pages 297-310, January 1994. Google ScholarDigital Library
- WO92 Mitchell Wand and Dino P. Oliva. Proving the correctness of storage representations. In Proceedings of the 1992 A CM Conference on Lisp and Functional Programming, pages 151-160, 1992. Google ScholarDigital Library
- YHR92 Wuu Yang, Susan Horowitz, and Thomas Reps. A program integration algorithm that accommodates semantics-preserving transformations. acre Transactions of Software Engineering and Methodology, 1(3):310-354, July 1992. Google ScholarDigital Library
- You89 William D. Young. A mechanically verified code generator. Journal of Automated Reasoning, 5(4):493-518, December 1989. Google ScholarDigital Library
Index Terms
- Translation validation for an optimizing compiler
Recommendations
Translation validation for an optimizing compiler
PLDI '00: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementationWe describe a translation validation infrastructure for the GNU C compiler. During the compilation the infrastructure compares the intermediate form of the program before and after each compiler pass and verifies the preservation of semantics. We ...
An optimizing compiler for lexically scoped LISP
SIGPLAN '82: Proceedings of the 1982 SIGPLAN symposium on Compiler constructionWe are developing an optimizing compiler for a dialect of the LISP language. The current target architecture is the S-I, a multiprocessing supercomputer designed at Lawrence Livermore National Laboratory. While LISP is usually thought of as a language ...
An optimizing compiler for lexically scoped LISP
Proceedings of the 1982 SIGPLAN symposium on Compiler constructionWe are developing an optimizing compiler for a dialect of the LISP language. The current target architecture is the S-I, a multiprocessing supercomputer designed at Lawrence Livermore National Laboratory. While LISP is usually thought of as a language ...
Comments