Date:	November 13, 1997

To:	J3

From:	Interval Subcommittee

Subject:	Ruminations on Interline Optimization

It has been previously noted that all Fortran compilers perform interline optimizations that are forbidden by the standard. Users demand and vendors provide such behavior.

The interval arithmetic exercise has highlighted the ramifications. In the case of interval arithmetic the consequences are a lack of sharpness and slower execution.

The 80-bit registers vs. 64-bit data types of the x86 architecture also exemplify the problem.

Fortran 90 Interpretation Number 1 illustrates the confusion caused in the minds of users.

In paper 229R1 on topics needed to support interval arithmetic the committee indicated a desire to investigate the problem.

After reflection, we believe that the optimizations permitted within a statement should apply to programs.

In accord with previous committee decisions there will be a "traditional" model of execution and a processor dependent (for example, a compiler option) method of changing between modes on a compilation unit basis. This does not preclude a finer-grained methodology later.

We looked at section 2.3.4, all of section 7, and section 8. Section 8 is not germane. Section 7 defines what is permitted within a statement. Section 7.1, page 87, lines 14 and 15 tell what an operand is. For increased clarity, we suggest that the Editor consider changing these two lines from:

An operand is either a scalar or an array. An operation is either intrinsic (7.2) or defined (7.3). More complicated expressions can be formed using operand which are themselves expressions.

to:

An operand is either a scalar, an array, or an expression. An operation is either intrinsic (7.2) or defined (7.3).

Section 2.3.4 describes program behavior in terms of execution of statements one at a time. We feel that an additional alternate description is needed.

Consider:

PROGRAM foo

x = f(1)

y = g(2)

z = h(3)

END

The functions f, g, and h, have the side effect of turning on a different light on the front panel. They do nothing else. The question is does execution of this program result in 0,1,2,3 or more than 3 lights being turned on. In the existing model the appropriate answer is 3. In the proposed model, we suggest that 0, 1, 2, or 3 lights are permissible; more than 3 would be non- standard conforming behavior.