skip to main content
article
Free Access

A retargetable compiler for ANSI C

Published:01 October 1991Publication History
Skip Abstract Section

Abstract

lcc is a new retargetable compiler for ANSI C. Versions for the VAX, Motorola 68020, SPARC, and MIPS are in production use at Princeton University and at AT&T Bell Laboratories. With a few exceptions, little about lcc is unusual --- it integrates several well engineered, existing techniques --- but it is smaller and faster than most other C compilers, and it generates code of comparable quality, lcc's target-independent front end performs a few simple, but effective, optimizations that contribute to good code; examples include simulating register declarations and partitioning switch statement cases into dense tables. It also implements target-independent function tracing and expression-level profiling.

References

  1. {1} A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, Reading, MA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. {2} American National Standard Institute, Inc., New York. American National Standards for Information Systems, Programming Language C ANSI X3.159-1989, 1990.Google ScholarGoogle Scholar
  3. {3} F. Baskett. The best simple code generation technique for while, for, and do loops. SIGPLAN Notices, 13(4):31-32, Apr. 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. {4} J. L. Bentley. Writing Efficient Programs. Prentice Hall, Englewood Cliffs, NJ, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. {5} R. L. Bernstein. Producing good code for the case statement. Software--Practice & Experience, 15(10):1021-1024, Oct. 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. {6} Computer Science Division, Department of Electrical Engineering and Computer Science, University of California, Berkeley, CA. UNIX User's Manual, Reference Guide, virtual VAX-11 version edition, Mar. 1984.Google ScholarGoogle Scholar
  7. {7} C. W. Fraser. A language for writing code generators. Proceedings of the SIGPLAN '89 Conference on Programming Language Design and Implementation, SIGPLAN Notices, 24(7):238-245, July 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. {8} C. W. Fraser and D. R. Hanson. Simple register spilling in a retargetable compiler. Software-Practice & Experience, submitted. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. {9} C. W. Fraser and D. R. Hanson. A code generation interface for ANSI C. Software--Practice & Experience, to appear, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. {10} S. L. Graham, P. B. Kessler, and M. K. McKusick. An execution profiler for modular programs. Software--Practice & Experience, 13(8):671-685, Aug. 1983.Google ScholarGoogle ScholarCross RefCross Ref
  11. {11} R. E. Griswold and M. T. Griswold. The Icon Programming Language. Prentice Hall, Englewood Cliffs, NJ, second edition, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. {12} D. R. Hanson. Simple code optimizations. Software-Practice & Experience, 13(8):745-763, Aug. 1983.Google ScholarGoogle ScholarCross RefCross Ref
  13. {13} D. R. Hanson. Fast allocation and deallocation of memory based on object lifetimes. Software-Practice & Experience, 20(1):5-12, Jan. 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. {14} B. W. Kernighan and D. M. Ritchie. The C Programming Language. Prentice Hall, Englewood Cliffs, NJ, second edition, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. {15} D. E. Knuth. An empirical study of FORTRAN programs. Software--Practice & Experience, 1(2):105-133, Apr. 1971.Google ScholarGoogle ScholarCross RefCross Ref
  16. {16} R. Sedgewick. Algorithms. Addison Wesley, Reading, MA, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. {17} R. L. Sites. Programming tools: Statement counts and procedure timings. SIGPLAN Notices, 13(12):98-101, Dec. 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. {18} Standards Performance Evaluation Corp. SPEC Benchmark Suite Release 1.0, Oct. 1989.Google ScholarGoogle Scholar
  19. {19} K. Thompson. A new C compiler. In Proceedings of the Summer 1990 UKUUG Conference, pages 41-51, London, July 1990.Google ScholarGoogle Scholar
  20. {20} W. M. Waite. The cost of lexical analysis. Software-Practice & Experience, 16(5):473-488, May 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. {21} P. J. Weinberger. Cheap dynamic instruction counting. Bell System Technical Journal, 63(8):1815-1826, Oct. 1984.Google ScholarGoogle Scholar

Index Terms

  1. A retargetable compiler for ANSI C

          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

          Full Access

          • Published in

            cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 26, Issue 10
            Oct. 1991
            85 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/122616
            Issue’s Table of Contents

            Copyright © 1991 Author

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 October 1991

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader