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

3.4 Options Reference

3.4.129 –xhasc[={yes|no}]

Treat Hollerith constant as a character string in an actual argument list.

With -xhasc=yes, the compiler treats Hollerith constants as character strings when they appear as an actual argument on a subroutine or function call. This is the default, and complies with the Fortran standard. (The actual call list generated by the compiler contains hidden string lengths for each character string.)

With -xhasc=no, Hollerith constants are treated as typeless values in subprogram calls, and only their addresses are put on the actual argument list. (No string length is generated on the actual call list passed to the subprogram.)

Compile routines with -xhasc=no if they call a subprogram with a Hollerith constant and the called subprogram expects that argument as INTEGER (or anything other than CHARACTER).

Example:

demo% cat hasc.f

call z(4habcd, ’abcdefg’) end

subroutine z(i, s) integer i character *(*) s

print *, "string length = ", len(s) return

end

demo% f95

-o has0 hasc.f

demo% has0

 

 

 

string length =

4

<-- should be 7

demo% f95

-o has1 -xhasc=no hasc.f

demo% has1

 

 

 

string length =

7

<-- now correct length for s

Passing 4habcd to z is handled correctly by compiling with -xhasc=no.

This flag is provided to aid porting legacy Fortran 77 programs.

3.4.130 –xhelp=flags

List the compiler option flags. Equivalent to -help.

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

3.4 Options Reference

3.4.131 –xhwcprof[={enable | disable}]

Enable compiler support for dataspace profiling.

With -xhwcprof enabled, the compiler generates information that helps tools associate profiled load and store instructions with the data-types and structure members (in conjunction with symbolic information produced with -g) to which they refer. It associates profile data with the data space of the target, rather than the instruction space, and provides insight into behavior that is not easily obtained from only instruction profiling.

While you can compile a specified set of object files with -xhwcprof, this option is most useful when applied to all object files in the application. This will provide coverage to identify and correlate all memory references distributed in the application's object files.

If you are compiling and linking in separate steps, use -xhwcprof at link time as well.

An instance of -xhwcprof=enable or -xhwcprof=disable overrides all previous instances of - xhwcprof in the same command line.

-xhwcprof is disabled by default. Specifying -xhwcprof without any arguments is the equivalent to -xhwcprof=enable.

-xhwcprof requires that optimization be turned on and that the debug data format be set to dwarf (-xdebugformat=dwarf), which is the default with current Oracle Developer Studio compilers.

-xhwcprof uses -xdebuginfo to automatically enable the minimum amount of debugging information it needs, so -g is not required.

The combination of -xhwcprof and -g increases compiler temporary file storage requirements by more than the sum of the increases due to -xhwcprof and -g specified alone.

-xhwcprof is implemented as a macro that expands to various other, more primitive, options as follows:

-xhwcprof -xdebuginfo=hwcprof,tagtype,line

-xhwcprof=enable -xdebuginfo=hwcprof,tagtype,line

-xhwcprof=disable -xdebuginfo=no%hwcprof,no%tagtype,no%line

The following command compiles example.f and specifies support for hardware counter profiling and symbolic analysis of data types and structure members using DWARF symbols:

f95 -c -O -xhwcprof -g example.f

Chapter 3 • Fortran Compiler Options

125

3.4 Options Reference

For more information on hardware counter-based profiling, see the Oracle Developer Studio 12.6: Performance Analyzer.

3.4.132 –xinline=list

Synonym for -inline.

3.4.133 -xinline_param=a[,a[,a]...]

Use this option to manually change the heuristics used by the compiler for deciding when to inline a function call.

This option only has an effect at -O3 or higher. The following sub-options have an effect only at -O4 or higher when automatic inlining is on.

In the following sub-options n must be a positive integer; a can be one of the following:

TABLE 21

-xinline_param Sub-options

 

 

 

Sub-option

 

Meaning

 

 

 

default

 

Set the values of all the sub-options to their default values.

 

 

max_inst_hard[:n]

Automatic inlining only considers functions smaller than n pseudo

 

 

instructions (counted in compiler's internal representation) as possible

 

 

inline candidates.

 

 

Under no circumstances will a function larger than this be considered for

 

 

inlining.

 

 

max_inst_soft[:n]

Set inlined function's size limit to n pseudo instructions (counted in

 

 

compiler's internal representation).

 

 

Functions of greater size than this may sometimes be inlined.

 

 

When interacting with max_inst_hard, the value of max_inst_soft

 

 

should be equal to or smaller than the value of max_inst_hard, i.e,

 

 

max_inst_soft <= max_inst_hard.

 

 

In general, the compiler's automatic inliner only inlines calls whose

 

 

called function's size is smaller than the value of max_inst_soft. In some

 

 

cases a function may be inlined when its size is larger than the value of

 

 

max_inst_soft but smaller than that of max_inst_hard. An example of

 

 

this would be if the parameters passed into a function were constants.

 

 

When deciding whether to change the value of max_inst_hard or

 

 

max_inst_soft for inlining one specific call site to a function, use -

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

 

 

 

3.4 Options Reference

 

 

 

 

 

 

 

 

 

 

 

Sub-option

Meaning

 

 

 

 

 

 

 

xinline_report=2 to report detailed inlining message and follow the

 

 

 

suggestion in the inlining message.

 

 

 

 

 

max_function_inst[:n]

Allow functions to increase due to automatic inlining by up to n pseudo

 

 

instructions (counted in compiler's internal representation).

 

 

 

 

 

max_growth[:n]

The automatic inliner is allowed to increase the size of the program by up

 

 

to n% where the size is measured in pseudo instructions.

 

 

 

 

 

min_counter[:n]

The minimum call site frequency counter as measured by profiling

 

 

feedback (-xprofile) in order to consider a function for automatic

 

 

inlining.

 

 

 

 

This option is valid only when the application is compiled with profiling

 

 

feedback (-xprofile=use).

 

 

 

 

 

level[:n]

Use this sub-option to control the degree of automatic inlining that is

 

 

applied. The compiler will inline more functions with higher settings for -

 

 

xinline_param=level.

 

 

n must be one of 1, 2, or 3.

 

 

The default value of n is 2 when this option is not specified, or when the

 

 

options is specified without :n.

 

 

Specify the level of automatic inline:

 

 

level:1

basic inlining

 

 

level:2

medium inlining (default)

 

 

level:3

aggressive inlining

 

 

The level decides the specified values for the combination of the

 

 

following inlining parameters:

 

 

max_growth

 

 

+ max_function_inst

 

 

+ max_inst

 

 

+ max_inst_call

 

 

When level = 1, all the parameters are half the values of the default.

 

 

When level = 2, all the parameters are the default value.

 

 

When level = 3, all the parameters are double the values of the default.

 

 

 

 

 

max_recursive_depth[:n]

When a function calls itself either directly or indirectly, it is said to be

 

 

making a recursive call.

 

 

This sub-option allows a recursive call to be automatically inlined up to n

 

 

levels.

 

 

 

 

 

 

 

max_recursive_inst[:n]

Specifies the maximum number of pseudo instructions (counted in

 

 

compiler's internal representation) the caller of a recursive function can

 

 

grow to by performing automatic recursive inlining.

 

 

When interactions between max_recursive_inst and

 

 

max_recursive_depth occur, recursive function calls will be inlined until

 

 

either the max_recursive_depth number of recursive calls, or until the

 

Chapter 3 • Fortran Compiler Options

127

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