24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

can also use the SNAPSHOT directive to create additional program points <strong>for</strong><br />

storage visibility by flushing registers to memory.<br />

Other Program Behavior Options<br />

The precision of compiler analyses is significantly affected by instructions that can<br />

read or write memory. Aliasing pertains to alternate names <strong>for</strong> things, which in<br />

this context are references to memory. A reference to memory can be direct, as in<br />

the case of a named symbol, or indirect, as in the case of a pointer or dummy<br />

argument. A function call might also reference memory indirectly. Apparent<br />

references to memory that are false, that is, that do not actually reference some<br />

location assumed by the compiler, constitute barriers to compiler analysis.<br />

<strong>Fortran</strong> defines a rule that dummy argument references may not overlap other<br />

dummy arguments or externally visible symbols during the execution of a<br />

subprogram.<br />

The compiler per<strong>for</strong>ms sophisticated analyses, attempting to refine the set of<br />

possible aliases <strong>for</strong> pointer dereferences and calls. However, a limited scope and<br />

the absence of values at compile time constrain the effectiveness of these analyses.<br />

Increasing the optimization level, in particular, applying interprocedural analysis<br />

(that is, compiling with -qipa), can contribute to better aliasing.<br />

Programs that violate language aliasing rules, as summarized above, commonly<br />

execute correctly without optimization or with low optimization levels, but can<br />

begin to fail when higher levels of optimization are attempted. The reason is that<br />

more aggressive optimizations take better advantage of aliasing in<strong>for</strong>mation and<br />

can there<strong>for</strong>e expose subtly incorrect program semantics.<br />

Options related to these issues are -qstrict and -qalias. Their behaviors are<br />

summarized in the table below.<br />

Program behavior options<br />

Option<br />

Description<br />

-qstrict, -qnostrict<br />

Allows the compiler to reorder floating-point calculations and<br />

potentially excepting instructions. A potentially excepting<br />

instruction is one that may raise an interrupt due to erroneous<br />

execution (<strong>for</strong> example, floating-point overflow, a memory access<br />

violation). The default is -qstrict with -qnoopt and -O2; -qnostrict<br />

with -O3, -O4, and -O5.<br />

-qalias<br />

Other Per<strong>for</strong>mance Options<br />

Allows the compiler to assume that certain variables do not refer<br />

to overlapping storage. The focus is on the overlap of dummy<br />

arguments and array assignments in <strong>Fortran</strong>.<br />

Options are provided to control particular aspects of optimization. They are often<br />

enabled as a group or given default values when a more general optimization<br />

option is enabled.<br />

Selected compiler options <strong>for</strong> optimizing per<strong>for</strong>mance<br />

Option<br />

Description<br />

320 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!