Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

3.4 Options Reference

Is established at runtime during the program initialization.

When the value is tozero, negative, or positive, the option sets the rounding direction to round-to-zero, round-to-negative-infinity, or round-to-positive-infinity, respectively, when the program begins execution. When -fround is not specified, -fround=nearest is used as the default and the rounding direction is round-to-nearest. The meanings are the same as those for the ieee_flags function.

3.4.37–fserialio

A linking option that specifies that the program does not perform I/O in more than one thread at a time. It allows Fortran I/O statements to be executed without performing synchronization to avoid race conditions. This option should be specified only when creating an executable program. It should not be specified when creating a shared object library nor should it be specified if the program includes code compiled with versions of Sun f77 before the Sun Forte 7 release.

3.4.38–fsimple[={1|2|0}]

Select floating–point optimization preferences.

Allow the optimizer to make simplifying assumptions concerning floating–point arithmetic.

For consistent results, compile all units of a program with the same -fsimple option.

The defaults are:

Without the -fsimple flag, the compiler defaults to -fsimple=0

With -fsimple without a value, the compiler uses -fsimple=1

The different floating–point simplification levels are:

–fsimple=0

Permit no simplifying assumptions. Preserve strict IEEE 754

 

conformance.

–fsimple=1

Allow conservative simplifications. The resulting code does not strictly

 

conform to IEEE 754.

 

With -fsimple=1, the optimizer can assume the following:

Chapter 3 • Fortran Compiler Options

73

3.4 Options Reference

IEEE 754 default rounding/trapping modes do not change after process initialization.

Computations producing no visible result other than potential floating point exceptions may be deleted.

Computations with Infinity or NaNs (“Not a Number”) as operands need not propagate NaNs to their results; for example, x*0 may be replaced by 0.

 

Computations do not depend on sign of zero.

 

With -fsimple=1, the optimizer is not allowed to optimize completely

 

without regard to roundoff or exceptions. In particular, a floating–point

 

computation cannot be replaced by one that produces different results

 

with rounding modes held constant at run time.

–fsimple=2

In addition to —fsimple=1, permit aggressive floating point

 

optimizations. This can cause some programs to produce different

 

numeric results due to changes in the way expressions are evaluated. In

 

particular, the Fortran standard rule requiring compilers to honor explicit

 

parentheses around subexpressions to control expression evaluation order

 

may be broken with -fsimple=2. This could result in numerical rounding

 

differences with programs that depend on this rule.

 

For example, with -fsimple=2, the compiler may evaluate C-(A-B)

 

as (C-A)+B, breaking the standard’s rule about explicit parentheses, if

 

the resulting code is better optimized. The compiler might also replace

 

repeated computations of x/y with x*z, where z=1/y is computed once

 

and saved in a temporary, to eliminate the costly divide operations.

 

Programs that depend on particular properties of floating-point arithmetic

 

should not be compiled with -fsimple=2.

 

-fsimple=2 allows fp-transformations which may introduce fp

 

exceptions.

 

–fast selects -fsimple=2.

3.4.39–fstore

(x86) Force precision of floating-point expressions.

For assignment statements, this option forces all floating-point expressions to the precision of the destination variable. This is the default. However, the -fast option includes -nofstore to disable this option. Follow -fast with -fstore to turn this option back on.

74 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

3.4 Options Reference

3.4.40–ftrap=t

Set floating–point trapping mode in effect at startup.

t is a comma–separated list that consists of one or more of the following:

%all, %none, common, [no%]invalid, [no%]overflow, [no%]underflow, [no%]division, [no %]inexact.

-ftrap=common is a macro for -ftrap=invalid,overflow,division.

The f95 default is -ftrap=common. This differs from the C and C++ compiler defaults, - ftrap=none.

Sets the IEEE 745 trapping mode in effect at startup but does not install a SIGFPE handler. You can use ieee_handler(3M) or fex_set_handling(3M) to simultaneously enable traps and install a SIGFPE handler. If you specify more than one value, the list is processed sequentially from left to right. The common exceptions, by definition, are invalid, division by zero, and overflow.

Example: -ftrap=%all,no%inexact means set all traps, except inexact.

The meanings for -ftrap=t are the same as for ieee_flags(), except that:

%all turns on all the trapping modes, and will cause trapping of spurious and expected exceptions. Use common instead.

%none turns off all trapping modes.

A no% prefix turns off that specific trapping mode.

To be effective, compile the main program with this option.

3.4.41–fvisibility

The -fvisibility=v option is equivalent to the -xldscope option as follows:

-fvisibility Options

Equivalent -xldscope Options

 

 

default

global

 

 

internal

hidden

 

 

protected

symbolic

 

 

Chapter 3 • Fortran Compiler Options

75

3.4 Options Reference

-fvisibility Options

Equivalent -xldscope Options

 

 

hidden

hidden

 

 

3.4.42–G

Build a dynamic shared library instead of an executable file.

Direct the linker to build a shared dynamic library. Without -G, the linker builds an executable file. With -G, it builds a dynamic library. Use -o with -G to specify the name of the file to be written.

3.4.43-g

See -g[n].

3.4.44–g[n]

Compile for debugging and performance analysis.

Produce additional symbol table information for debugging with dbx(1) debugging utility and for performance analysis with the Performance Analyzer.

Although some debugging is possible without specifying -g, the full capabilities of dbx and debugger are only available to those compilation units compiled with -g.

Some capabilities of other options specified along with -g may be limited. See the dbx documentation for details.

To use the full capabilities of the Performance Analyzer, compile with -g. While some performance analysis features do not require -g, you must compile with -g to view annotated source, some function level information, and compiler commentary messages. (See the analyzer(1) man page and the Oracle Developer Studio 12.6: Performance Analyzer.)

The commentary messages generated with -g describe the optimizations and transformations the compiler made while compiling your program. The messages, interleaved with the source code, can be displayed by the er_src(1) command.

76 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

Соседние файлы в предмете Информационные и сетевые технологии