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

3.4 Options Reference

keyword

Feature

 

 

 

For details, see the Oracle Developer Studio 12.6: C User’s Guide.

 

 

no%init_local

Disable local variable initialization. This is the default.

 

 

%all

Turn on all these runtime checking features.

 

 

%none

Disable all these runtime checking features.

 

 

Stack overflows, especially in multithreaded applications with large arrays allocated on the stack, can cause silent data corruption in neighboring thread stacks. Compile all routines with - xcheck=stkovf if stack overflow is suspected. But note that compiling with this flag does not guarantee that all stack overflow situations will be detected since they could occur in routines not compiled with this flag.

3.4.117.1 Defaults

If you do not specify -xcheck, the compiler defaults to-xcheck=noreturn. If you specify - xcheck without any arguments, the compiler defaults to-xcheck=%all, unless you are on an Oracle Solaris system for SPARC, in which case the compiler defaults to -xcheck=stkovf: detect for both cases.

The -xcheck option does not accumulate on the command line. The compiler sets the flag in accordance with the last occurrence of the command.

3.4.118 –xchip=c

Specify target processor for the optimizer.

This option specifies timing properties by specifying the target processor.

Although this option can be used alone, it is part of the expansion of the –xtarget option; it is provided to allow overriding a -xchip value implied by the a specific -xtarget option.

Some effects of -xchip=c are:

Instruction scheduling

The way branches are compiled

Choice between semantically equivalent alternatives

The following tables list the valid -xchip processor name values:

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

3.4 Options Reference

TABLE 18

Common –xchip SPARC Processor Names

 

 

 

-xchip=

 

Optimize for:

 

 

 

generic

 

most SPARC processors. (This is the default.)

 

 

 

native

 

this host platform.

 

 

sparc64vi (Obsolete)

SPARC64 VI processor

 

 

sparc64vii (Obsolete)

SPARC64 VII processor

 

 

 

sparc64viiplus

 

SPARC64 VII+ processor

 

 

 

sparc64x

 

SPARC64 X processor

 

 

 

sparc64xplus

 

SPARC64 X+ processor

 

 

 

sparc64xii

 

SPARC64 XII processor.

 

 

ultraT1 (Obsolete)

UltraSPARC T1 processor

 

 

ultraT2 (Obsolete)

UltraSPARC T2 processor

 

 

ultraT2plus (Obsolete)

UltraSPARC T2+ processor

 

 

 

T3 (Obsolete)

 

SPARC T3 processor

 

 

 

T4

 

SPARC T4 processor

 

 

 

T5

 

Uses the timing properties of the SPARC T5 processor.

 

 

 

T7

 

Uses the timing properties of the SPARC T7 processor.

 

 

 

M5

 

Uses the timing properties of the SPARC M5 processor.

 

 

 

M6

 

Uses the timing properties of the SPARC M6 processor.

 

 

 

M7

 

Uses the timing properties of the SPARC M7 processor.

 

 

 

TABLE 19

x86 –xchip flags

 

 

 

Flag

 

Meaning

 

 

 

generic

 

Use timing properties for good performance on most x86 architectures. This is

 

 

the default value. It directs the compiler to use the best timing properties for good

 

 

performance on most processors without major performance degradation on any of them.

 

 

 

native

 

Set the parameters for the best performance on the host environment.

 

 

 

core2

 

Optimize for the Intel Core2 processor.

 

 

 

nehalem

 

Optimize for the Intel Nehalem processor.

 

 

 

opteron

 

Optimize for the AMD Opteron processor.

 

 

 

penryn

 

Optimize for the Intel Penryn processor.

 

 

 

pentium

 

(Obsolete) Uses timing properties of the x86 Pentium architecture.

 

 

 

pentium_pro

 

(Obsolete) Uses timing properties of the x86 Pentium Pro architecture.

 

 

 

pentium3

 

(Obsolete) Uses timing properties of the x86 Pentium 3 architecture.

 

 

 

pentium4

 

(Obsolete) Uses timing properties of the x86 Pentium 4 architecture.

 

 

amdfam10 (Obsolete)

Optimize for the AMD AMDFAM10 processor.

 

 

 

Chapter 3 • Fortran Compiler Options

115

3.4 Options Reference

Flag

Meaning

 

 

sandybridge

Intel Sandy Bridge processor.

 

 

ivybridge

Intel Ivy Bridge processor.

 

 

haswell

Intel Haswell processor.

 

 

westmere

Intel Westmere processor.

 

 

broadwell

Intel Broadwell processor.

 

 

skylake

Intel Skylake processor.

 

 

3.4.119 -xcode[=v]

(SPARC) Specify code address space.

Note - Build shared objects by specifying -xcode=pic13 or -xcode=pic32. While you can build workable shared objects with -m64 -xcode=abs64 they will be inefficient. Shared objects built with -m64, -xcode=abs32, or -m64, -xcode=abs44 will not work.

The following table lists the values for v.

TABLE 20

The -xcode Flags

 

 

 

 

Value

Meaning

 

 

 

abs32

This is the default on 32-bit architectures. Generates 32-bit absolute addresses. Code + data + BSS

 

size is limited to 2**32 bytes.

 

 

 

abs44

This is the default on 64-bit architectures. Generates 44-bit absolute addresses. Code + data + BSS

 

size is limited to 2**44 bytes. Available only on 64–bit architectures.

 

 

 

 

abs64

Generates 64-bit absolute addresses. Available only on 64-bit architectures.

 

 

 

 

pic13

Generates position-independent code for use in shared libraries (small model). Equivalent to

-

 

Kpic. Permits references to at most 2**11 unique external symbols on 32-bit architectures, 2**10

 

on 64-bit architectures.

 

 

 

 

pic32

Generates position-independent code for use in shared libraries (large model). Equivalent to

-KPIC.

 

Permits references to at most 2**30 unique external symbols on 32-bit architectures, 2**29 on 64-

 

bit architectures.

 

 

 

 

The default is -xcode=abs32 for 32–bit architectures. The default for 64–bit architectures isxcode=abs44.

When building shared dynamic libraries, the default -xcode values of abs44 and abs32 will not work with 64–bit architectures. Specify -xcode=pic13 or -xcode=pic32 instead. Two nominal performance costs with -xcode=pic13 and -xcode=pic32 on SPARC are:.

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

3.4 Options Reference

A routine compiled with either -xcode=pic13 or -xcode=pic32 executes a few extra instructions upon entry to set a register to point at a table (_GLOBAL_OFFSET_TABLE_) used for accessing a shared library’s global or static variables.

Each access to a global or static variable involves an extra indirect memory reference through _GLOBAL_OFFSET_TABLE_. If the compilation includes -xcode=pic32, there are two additional instructions per global and static memory reference.

When considering these costs, remember that the use of -xcode=pic13 and -xcode=pic32 can significantly reduce system memory requirements due to the effect of library code sharing. Every page of code in a shared library compiled -xcode=pic13 or -xcode=pic32 can be shared by every process that uses the library. If a page of code in a shared library contains even a single non-pic (that is, absolute) memory reference, the page becomes nonsharable, and a copy of the page must be created each time a program using the library is executed.

The easiest way to tell whether a .o file has been compiled with -xcode=pic13 or - xcode=pic32 is by using the nm command:

% nm file.o | grep _GLOBAL_OFFSET_TABLE_ U _GLOBAL_OFFSET_TABLE_

A .o file containing position-independent code contains an unresolved external reference to _GLOBAL_OFFSET_TABLE_, as indicated by the letter U.

To determine whether to use -xcode=pic13 or -xcode=pic32, check the size of the Global Offset Table (GOT) by using elfdump -c looking for the section header sh_name: .got. The sh_size value is the size of the GOT. If the GOT is less than 8,192 bytes, specify - xcode=pic13. Otherwise specify -xcode=pic32.See the elfdump(1) man page for more information.

Follow these guidelines to determine how you should use -xcode:

If you are building an executable, do not use -xcode=pic13 or -xcode=pic32.

If you are building an archive library only for linking into executables, do not use - xcode=pic13 or -xcode=pic32.

If you are building a shared library, start with -xcode=pic13 and, once the GOT size exceeds 8,192 bytes, use -xcode=pic32.

If you are building an archive library for linking into shared libraries, use -xcode=pic32.

3.4.120 –xcommonchk[={yes|no}]

Enable runtime checking of common block inconsistencies.

Chapter 3 • Fortran Compiler Options

117

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