This Article 
 Bibliographic References 
 Add to: 
Automatic Detection and Diagnosis of Faults in Generated Code for Procedure Calls
November 2003 (vol. 29 no. 11)
pp. 1031-1042
Jack W. Davidson, IEEE Computer Society

Abstract—In this paper, we present a compiler testing technique that closes the gap between existing compiler implementations and correct compilers. Using formal specifications of procedure-calling conventions, we have built a target-sensitive test suite generator that builds test cases for a specific aspect of compiler code generators: the procedure-calling sequence generator. By exercising compilers with these specification-derived target-specific test suites, our automated testing tool has exposed bugs in every compiler tested on the MIPS and one compiler on the SPARC. These compilers include some that have been in heavy use for many years. Once a fault has been detected, the system can often suggest the nature of the problem. The testing system is an invaluable tool for detecting, isolating, and correcting faults in today's compilers.

[1] M.W. Bailey and J.W. Davidson, A Formal Model and Specification Language for Procedure Calling Conventions Proc. ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, pp. 298-310, Jan. 1995.
[2] S.C. Johnson and D.M. Ritchie, The C Language Calling Sequence Computing Science Technical Report No. 102, Bell Labs, Sept. 1981
[3] B. W. Kernighan and D. M. Ritchie,The C Programming Language. Englewood Cliffs, NJ: Prentice-Hall, 1988, 2nd ed.
[4] W.L. Johnson, J.H. Porter, S.I. Ackley, and D.T. Ross, Automatic Generation of Efficient Lexical Processors Using Finite State Techniques Comm. ACM, vol. 11, no. 12, pp. 805-813, 1968.
[5] T.A. Proebsting and C.W. Fraser, Detecting Pipeline Structural Hazards Quickly Proc. ACM SIGPLAN-SIGACT Symp. Principles of Programming Languages, pp. 280-286, 1994.
[6] T. Müller, Employing Finite Automata for Resource Scheduling Proc. 26th Ann. Int'l Symp. Microarchitecture, pp. 12-20, 1993.
[7] G.H. Mealy, A Method for Synthesizing Sequential Circuits Bell System Technical J., vol. 35, no. 5, pp. 1045-1079, 1955.
[8] J.E. Hopcroft and J.D. Ullman, Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Apr. 1979.
[9] F.C. Hennie, Fault Detecting Experiments for Sequential Circuits Proc. Fifth Ann. Symp. Switching Theory and Logical Design, pp. 95-110, Nov. 1964.
[10] Z. Kohavi, Switching and Finite Automata Theory, second ed. McGraw-Hill, 1978.
[11] D.P. Sidhu and T.K. Leung, Formal Methods for Protocol Testing: A Detailed Study IEEE Trans. Software Eng., vol. 15, no. 4, pp. 413-426, Apr. 1991.
[12] S. Fujiwara, V.G. Bochmann, F. Khendek, M. Amalou, and A. Ghedamsi, “Test Selection Based on Finite State Machine Model,” IEEE Trans. Software Eng., vol. 17, no. 6, pp. 591-603, June 1991.
[13] A.V. Aho, A.T. Dahbura, D. Lee, and M.U. Uyar, “An Optimization Technique for Protocol Conformance Test Sequence Generation Based on UIO Sequences and Rural Chinese Postman Tours,” IEEE Trans. Comm., vol. 39, pp. 1604-1615, 1991.
[14] M. Yannakakis and D. Lee, “Testing Finite State Machines: Fault Detection,” J. Computer and System Sciences, vol. 50, pp. 209-227, 1995.
[15] R.C. Ho, C.H. Yang, M.A. Horowitz, and D.L. Dill, Architecture Validation for Processors Proc. Int'l Symp. Computer Architecture, pp. 404-413, 1995.
[16] A.W. Appel, personal communication, May 1996.
[17] C.W. Fraser and D.R. Hanson, “A Code Generation Interface for ANSI C. Software—Practice and Experience, vol. 21, no. 9, pp. 963–988, Sept. 1991.
[18] C. Fraser and D. Hanson, A Retargetable C Compiler: Design and Implementation, Benjamin/Cummings Publishing, Redwood City, Calif., 1995; .
[19] R.M. Stallman, Using and Porting GNU CC (Version 2.0). Free Software Foundation, Inc., Feb. 1992.
[20] M.E. Benitez and J.W. Davidson, "A Portable Global Optimizer and Linker," Proc. SIGPLAN '88 Symp. Programming Language Design and Implementation, pp. 329-338, June 1988.
[21] G.E. Weaver, B.D. Cahoon, J.E.B. Moss, K.S. McKinley, E.J. Wright, and J.H. Burrill, The Common Language Encoding Form (CLEF) Design Document Technical Report 97-58, Dept. of Computer Science, Univ. of Massachusetts, Amherst, Aug. 1997.

Index Terms:
Target-sensitive test suite generation, automatic fault isolation, procedure-calling convention, code generation, compiler testing and debugging.
Mark W. Bailey, Jack W. Davidson, "Automatic Detection and Diagnosis of Faults in Generated Code for Procedure Calls," IEEE Transactions on Software Engineering, vol. 29, no. 11, pp. 1031-1042, Nov. 2003, doi:10.1109/TSE.2003.1245304
Usage of this product signifies your acceptance of the Terms of Use.