Browse Prior Art Database

Multiple-Statement Code Mapping

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

Publishing Venue

IBM

Related People

Besaw, K: AUTHOR [+5]

Abstract

When a compiler performs certain types of code optimization where a single fragment of executable code is generated for several high level language (HLL) source statements, it is beneficial to create a mapping from that code fragment to each of the source statements it was generated for. This mapping is to be used for reporting to the user the statement number in which a run time exception or error condition occurred. In the case of a mapping to more than one statement number, the user is informed of a list of the statements where the exception could have possibly occurred.

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

Multiple-Statement Code Mapping

      When a compiler performs certain types of code optimization
where a single fragment of executable code is generated for several
high level language (HLL) source statements, it is beneficial to
create a mapping from that code fragment to each of the source
statements it was generated for.  This mapping is to be used for
reporting to the user the statement number in which a run time
exception or error condition occurred.  In the case of a mapping to
more than one statement number, the user is informed of a list of the
statements where the exception could have possibly occurred.

      An optimizing compiler will sometimes produce a single common
fragment of executable code for several different fragments of high
level language (HLL) source.  For example, consider the following
sequence of source code statements:

10     i = 10;
11     loop: if x > z then
12       z = ( i + a ) * 4;
13     else
14       x = ( i + a ) * 4;
15     i = i + 1;
16     if i < 100 then
17       goto loop;

      Using a global optimization technique, the code generated to
compute the value of ( i + a ) * 4 at line numbers 12 and 14 may be
moved outside of the if-then-else construct to a single fragment of
generated code.  The effect would be that the code produced would
resemble what would be generated for this sequence of statements:

10     i = 10;
     T = ( i + a ) * 4;
11     loop: if x > z then
12       z = T;
13     else
14       x = T;
15     i = i + 1;
     T = T + 4;
16     if i < 100 then
17       goto loop;

      This code is more efficient, since instead of computing ( i + a
) * 4 each time through the loop, the temporary T, which is assigned
to either z or x, is incremented by 4.  The optimization technique
empl...