Nothing Special   »   [go: up one dir, main page]

skip to main content
article
Free access

Source-level debugging of scalar optimized code

Published: 01 May 1996 Publication History

Abstract

Although compiler optimizations play a crucial role in the performance of modern computer systems, debugger technology has lagged behind in its support of optimization. Yet debugging the unoptimized translation is often impossible or futile, so handling of code optimizations in the debugger is necessary. But compiler optimizations make it difficult to provide source-level debugger functionality: Global optimizations can cause the runtime value of a variable to be inconsistent with the source-level value expected at a breakpoint; such variables are called endangered variables. A debugger must detect and warn the user of endangered variables otherwise the user may draw incorrect conclusions about the program. This paper presents a new algorithm for detecting variables that are endangered due to global scalar optimization. Our approach provides more precise classifications of variables and is still simpler than past approaches. We have implemented and evaluated our techniques in the context of the cmcc optimizing C compiler. We describe the compiler extensions necessary to perform the required bookkeeping of compiler optimization. We present measurements of the effect of optimizations on a debugger's ability to present the expected values of variables to the user.

References

[1]
A. Adl-Tabatabai. Source-Level Debugging of Globally Optimized Code. PhD thesis, Carnegie Mellon University, 1996.
[2]
A. Adl-Tabatabai and T. Gross. Detection and recovery of endangered variables caused by instruction scheduling. In Proc. ACM SIGPLAN'93 Conf. on Prog. Language Design and implementation, pages 13-25. ACM, June 1993.
[3]
A. Adl-Tabatabai and T. Gross. Evicted variables and the interaction of global register allocation and symbolic debugging. In Conf. Record of the 20th Annuai ACM Syrup. on Principles of Prog. Lang., pages 371-383. ACM, January 1993.
[4]
A. V. Aho, R. Sethi, and J. D. Ullman. Compilers Principles, Techniques, and Tools. Addison-Wesley, 1986.
[5]
D. Bemstein and M. Rodeh. Global instruction scheduling for superscalar machines. In Proc. ACM SIGPLAN '91 Conf. on Pro& Language Design and Implementation, pages 241--255. ACM, June 1991.
[6]
P. Briggs and K. Cooper. Effective partial redundancy elimination. In Proc. ACM SIGPLAN'94 Conf. on Prog. Language Design and Implementation, pages 159-170. ACM, June 1994.
[7]
P. Briggs, K. D. Cooper, K. Kennedy, and L. Torczon. Coloring heuristics for register allocation. In Proc. A CM SIGPLAN'89 Conf. on Prog. Language Design and Implementation, pages 275-284. ACM, July 1989.
[8]
G. Brooks, G. Hansen, and S. Simmons. A new approach to debugging optimized code. In Proc. ACM SiGPLAN'92 Conf. on Prog. Language Design and implementation, pages 1-I 1. ACM, June 1992.
[9]
G. J. Chaitin. Register allocation and spilling via graph coloring. in Proc. ACM SIGPLAN 1982 Symp. on Compiler Construction, pages 98-105, June 1982. In SIGPLAN Notices, v. 17, n. 6.
[10]
P. P. Chang, S. A. Mahlke, W. Y. Chen, N. J. Warter, and W. W. Hwu. Impact: An architectural framework for multipleinstmction-issue processors. In Proc. 18th Intl. Syrup. on Computer Architecture, pages 266-275. ACM/IEEE, May 1991.
[11]
P. P. Chang, S. A. Mahlke, and W. W. Hwu. Using profile information to assist classic code optimizations. Software Practice and Experience, 21 (12): 1301-1321, Dec 1991.
[12]
F. Chow. A Portable, Machine-independent Global Optimizer Design and Measurements. PhD thesis, Stanford University, 1984.
[13]
M. Copperman. Debugging optimized code without being misled. ACM Trans. on Prog. Lang. Syst., 16(3):387--427, May 1994.
[14]
D.S. Coutant, S. Meloy, and M. Ruscetta. Doc: A practical approach to source-level debugging of globally optimized code. In Proc. ACM SIGPLAN'88 Conf. on Prog. Language Design and Implementation, pages 125-134. ACM, June 1988.
[15]
D.M. Dhamdhere. Practical adaptation of the global optimization algorithm of morel and renvoise. ACM Transactions on Programming Languages and Systems, 13(2):291-294, April 1991.
[16]
D.M. Dhamdhere, B.K. Rosen, and EK. Zadeck. How to analyze large programs efficiently and informatively, in Proc. ACM SIGPLAN'92 Conf. on Prog. Language Design and Implementation, pages 212-223. ACM, June 1992.
[17]
D. Ebcioglu, R. Groves, K. Kim, G. Silberman, and I. Ziv. Vliw compilation techniques in a superscalar environment. In Proc. ACM SIGPLAN'94 Conf. on Prog. Language Design and Implementation, pages 36-48. ACM, June 1994.
[18]
C. Fraser and D. Hanson. A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings, 1995.
[19]
J.L. Hennessy. Symbolic debugging of optimized code. ACM Trans. on Prog. Lang. Syst., 4(3):323-344, July 1982.
[20]
J. Knoop, O. Ruthing, and B. Steffen. Lazy strength reduction. Journal of Prog. Languages, 1(1):71-91, 1993.
[21]
J. Knoop, O. Ruthing, and B. Steffen. Optimal code motion: Theory and practice. ACM Trans. on Prog. Lang. Syst., 16(4):1117-1155, July 1994.
[22]
j. Knoop, O. Ruthing, and B. Steffen. Partial dead code elimination. In Proc. ACM SIGPLAN'94 Conf. on Prog. Language Design and implementation, pages 147-158. ACM, June 1994.
[23]
E. Morel and C. Renvoise. Global optimization by suppression of partial redundancies. Communications of the ACM, 22(2):96-103, Feb 1979.
[24]
R. Wismueller. Debugging of globally optimized programs using data flow analysis. In Proc. A CM SIGPLAN'94 Conf. on Prog. Language Design and Implementation, pages 278-289. ACM, June 1994.
[25]
R. Wismueller. Quellsprachorientiertes Debugging yon optimierten Programmen. PhD thesis, Technische Universitaet Muenchen, Munich, Germany, Dec. 1994. (in German). Published (1995) by Shaker Verlag, Aachen (Germany), ISBN 3-8265-0841-6.
[26]
P. Zellweger. Interactive Source-Level Debugging of Optimized Programs. PhD thesis, University of California, Berkeley, May 1984. Published as Xerox PARC Technical Report CSL-84-5.

Cited By

View all
  • (2021)Automated bug localization in JIT compilersProceedings of the 17th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments10.1145/3453933.3454021(153-164)Online publication date: 7-Apr-2021
  • (2011)Integrating program analyses with programmer productivity toolsSoftware—Practice & Experience10.1002/spe.103541:7(817-840)Online publication date: 1-Jun-2011
  • (2006)Symbolic debugging of embedded hardware and softwareIEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems10.1109/43.91375720:3(392-401)Online publication date: 1-Nov-2006
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 31, Issue 5
May 1996
300 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/249069
Issue’s Table of Contents
  • cover image ACM Conferences
    PLDI '96: Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation
    May 1996
    300 pages
    ISBN:0897917952
    DOI:10.1145/231379
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 1996
Published in SIGPLAN Volume 31, Issue 5

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)124
  • Downloads (Last 6 weeks)26
Reflects downloads up to 13 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2021)Automated bug localization in JIT compilersProceedings of the 17th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments10.1145/3453933.3454021(153-164)Online publication date: 7-Apr-2021
  • (2011)Integrating program analyses with programmer productivity toolsSoftware—Practice & Experience10.1002/spe.103541:7(817-840)Online publication date: 1-Jun-2011
  • (2006)Symbolic debugging of embedded hardware and softwareIEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems10.1109/43.91375720:3(392-401)Online publication date: 1-Nov-2006
  • (2005)TdbProceedings of the sixth international symposium on Automated analysis-driven debugging10.1145/1085130.1085147(123-132)Online publication date: 19-Sep-2005
  • (2000)Symbolic debugging scheme for optimized hardware and softwareProceedings of the 2000 IEEE/ACM international conference on Computer-aided design10.5555/602902.602913(40-43)Online publication date: 5-Nov-2000
  • (2000)Symbolic debugging scheme for optimized hardware and softwareIEEE/ACM International Conference on Computer Aided Design. ICCAD - 2000. IEEE/ACM Digest of Technical Papers (Cat. No.00CH37140)10.1109/ICCAD.2000.896448(40-43)Online publication date: 2000
  • (2000)Symbolic debugging of globally optimized behavioral specificationsProceedings 2000. Design Automation Conference. (IEEE Cat. No.00CH37106)10.1109/ASPDAC.2000.835132(397-400)Online publication date: 2000
  • (1999)Comparison Checking: An Approach to Avoid Debugging of Optimized CodeSoftware Engineering — ESEC/FSE ’9910.1007/3-540-48166-4_17(268-284)Online publication date: 27-Aug-1999
  • (1998)Dynamic currency determination in optimized programsACM Transactions on Programming Languages and Systems10.1145/295656.29565720:6(1111-1130)Online publication date: 1-Nov-1998
  • (1997)Debugging highly-optimized Ada with code motion (DHACM)Proceedings of the conference on TRI-Ada '9710.1145/269629.269650(197-203)Online publication date: 1-Nov-1997
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media