Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Controlling Code Optimization Based on Debug Requirements

IP.com Disclosure Number: IPCOM000104650D
Original Publication Date: 1993-May-01
Included in the Prior Art Database: 2005-Mar-19
Document File: 2 page(s) / 70K

Publishing Venue

IBM

Related People

Hicks, DR: AUTHOR [+4]

Abstract

A compiler may provide an option which allows the user to specify the debug functions which are to be supported when the generated program is run. This is used to fine tune the optimization performed by the compiler by preventing certain optimizations from occurring at specific key points in the program, while allowing all other occurrences of code optimization to take place.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Controlling Code Optimization Based on Debug Requirements

      A compiler may provide an option which allows the user to
specify the debug functions which are to be supported when the
generated program is run.  This is used to fine tune the optimization
performed by the compiler by preventing certain optimizations from
occurring at specific key points in the program, while allowing all
other occurrences of code optimization to take place.

      A high level language (HLL) compiler may provide an option
which allows the end-user to specify the debug functions that are
desired during the execution of the generated program.  Debug
functions include the setting of breakpoints, which are points in the
program where execution may be interrupted, and the ability to
display and/or modify user variables when a breakpoint is reached.
In order to support each of these functions, certain code
optimizations must not be performed.  Fig. 1 is an example of a code
optimization which must be prevented in order to allow a user
variable to be displayed at a particular breakpoint.

     Before optimization
     5 a:= b + c
     6 x:= y * a
     <no further uses of a>

     After optimization
     5
     6 x:= y * (b + c)

                           FIG. 1

      Fig. 1 illustrates an occurrence of two optimization techniques
employed to "eliminate" the code which would have been generated for
statement number 5.  The first technique is called "copy
propagation."  Since it is known that the value of variable 'a' must
be equal to 'b + c' at statement number 6, 'a' is replaced with 'b +
c' on the right hand side of the expression in that statement.
Additionally, a second optimization is performed, known as "store
elimination."  Since there is no use of variable 'a' after statement
number 5 (since it was replaced with 'b + c' at statement 6), the
store to 'a' is "eliminated."  The final consequence is that no code
...