Go to main content
Oracle® Developer Studio 12.6: GCC Compatibility Guide

Exit Print View

Updated: June 2017
 
 

Compiler Compatibility

This section discusses compiler features and other behaviors that affect compatibility between Oracle Developer Studio and GCC.

Implementation Defined Behavior

Some parts of the C and C++ standards are left as “implementation defined behavior”. These details are defined in the GCC and Oracle Developer Studio documentation, and they differ in some ways.

Both bit-fields and enumerated types can be either signed or unsigned by the choice of the compiler. For enums, this choice can vary based on the list of enumerated values. The behavior of Oracle Developer Studio C and C++ is different from the behavior of gcc.

Signed and Unsigned int Bit-fields

Bit-fields which are declared as int (not signed int or unsigned int) can be implemented by the compiler using either signed or unsigned types. This makes a difference when extracting a value and deciding whether to sign extend it.

The Oracle Developer Studio compiler uses unsigned types for int bit-fields and the gcc compiler uses signed types. Use the gcc –funsigned-bitfields flag to control this behavior.

For more information, see the sixth list item at https://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Non_002dbugs.html.

Signed and Unsigned enum Types

The gcc compiler performs a kind of optimization related to the types of enums. If an enum type has no negative values defined for it, then the internal type used by the compiler will be an unsigned type. If you cast a negative value into that type, it will be treated as a large unsigned value.

The C language standard enables the compiler to choose either signed or unsigned int types to store enums, as long as the type is compatible with all the defined enum values. The Oracle Developer Studio C compiler always uses signed int types for enums.


Note -  The type of an enumeration value in standard C is defined to be signed int.

In Oracle Developer Studio 12.6, the C compiler supports the option –features=gcc_enums to implement the same behavior as gcc for enums.

Note that this behavior is quite different from the way enums are implemented when the -fshort-enums flag is in effect. Oracle Developer Studio 12.6 has the –fshort-enums option similar to gcc. However, it is not recommended. It also affects the layout of structs in headers for libraries that might not have been compiled with fshort-enums. The result would be buggy code.

Characters in Identifiers

In Oracle Developer Studio 12.6, C++ compiler added the ability to use unicode character in symbols with \u and \U prefixes.

Valid Keywords

Oracle Developer Studio and GCC differ in the way keywords have spellings. For example, the C 99 keyword restrict can be spelt as restrict, _restrict or __restrict__. The spellings that are valid at any time will be affected by the language mode, such as C 99 vs C 11. If you have an application that uses a keyword with a specific spelling, then you can use a command line argument to define it as a macro. For example, -D__restrict=restrict.

GCC defines a special category of hidden keywords that have leading and trailing underscores. These variant spellings are enabled in all compilation modes so that system headers can use them regardless of whether the current standards mode allow the main keyword or not. For example, __restrict__ will be enabled in all modes, even when restrict is not valid.

Compiler Standards Conformance

The following compiler options affect the standards conformance modes:

  • –pedantic (and -Wpedantic, -pedantic errors).

  • –std. For example, -std=c11 or -std=c++11 or -std=gnu11.

  • -D__EXTENSIONS__, that enables Oracle Solaris extension APIs even in conformance modes.

Sometimes, the Oracle Solaris system headers react in different ways to GNU and Oracle Developer Studio compilers based on the different CPP symbols that are predefined.

The Oracle Developer Studio 12.6 C++ compiler defines the __STDC__ macro to the value 0 on the Oracle Solaris platform. Other C++ compilers (including g++) set this macro to 1. If your code depends on this value, it can be overidden on the command line with -D__STDC__=1.

Strict and Feature-Enabled -std Options

The Oracle Developer Studio 12.6 C compiler release includes new language standard options that are compatible with GCC. GCC defines different variations of language standards to differentiate between strict conformance and extensions enabled. When compiling in strict mode, gcc defines a gcc-specific symbol called __STRICT_ANSI__. The latest Oracle Developer Studio release defines this symbol in the same language modes where gcc defines it.

For more information, see Options Controlling C Dialect.

Table 1  Types of -std Options
-std Option Family
gcc
Oracle Developer Studio 12.5
Oracle Developer Studio 12.6
Strict Conformance
-std=c99 (or c11, etc)
Implemented
__STRICT_ANSI__
Implemented
No __STRICT_ANSI__
(default)
Implemented
__STRICT_ANSI__
Feature-Enabled
-std=gnu99 (or gnu11, etc)
Implemented
(default)
Not Implemented
Implemented
(default)

As the table shows, the default value of the -std option moves to the with extensions variant instead of the strict variant.

On Linux, the gcc symbol __STRICT_ANSI__ was already defined by Oracle Developer Studio, but since the default –std option is changing to non-strict, that behavior will change in the new release. In order to retain the old behavior on Linux, you can specify -std=c11 option.

In Oracle Developer Studio 12.6, the only difference between these modes is the presence of __STRICT_ANSI__. Extensions might be disabled as necessary in order for the compiler to implement a strict standards conformance mode.

The following features provide compatible experience for most users.

  • Implementation of gnu language modes.

  • __STRICT_ANSI__ defined in non-gnu modes.

  • Transition of the default mode from strict to gnu.

The following features might provide incompatible experience to the users.

  • Users on Linux who depend on __STRICT_ANSI__.

  • Users who explicitly specify the –std option will now have __STRICT_ANSI__ set.

Inlining

The Oracle Developer Studio C compiler and GCC C compiler had support for declaring functions as inline before the behavior was standardized. Both these compilers implement the new standard behavior and have flags to enable backward compatibility to the inline behavior.

GCC and Oracle Developer Studio have the options -fgnu89-inline and -xfeatures=extinl respectively. For more information, see Inline Functions in the GCC documentation.

C Language Extensions

Many C language extensions in Oracle Developer Studio are also implemented in Oracle Developer Studio C++. Some of the C extensions are documented in Extensions in Oracle Developer Studio 12.6: C User’s Guide. For the list of gcc language extensions, see Extensions to the C Language Family in the GCC documentation.

Some of the items listed in the gcc table are now standard features of a relevant language standard and are listed in Table 2 as C 11, C 99, C++ 03, C++ 11, and C++ 14.

Features of a newer language standard are often available as an extension when compiling according to older language standards unless either they conflict with existing code or you are using an option to enable a strict conformance mode. For more information about features that are available in different modes, see the documentation for that compiler.

The following table lists the extensions that are implemented in Oracle Developer Studio.

Table 2  GCC Extensions implemented in Oracle Developer Studio
GCC Extension
Oracle Developer Studio Implementation Status
Statement Expressions: Putting statements and declarations inside expressions.
Implemented.
Local Labels: Labels local to a block.
Implemented in C only.
Labels as Values: Getting pointers to labels, and computed gotos.
Implemented in C only.
Nested Functions: As in Algol and Pascal, lexical scoping of functions.
Not Implemented.
Constructing Calls: Dispatching a call to another function.
Not Implemented.
Typeof: referring to the type of an expression.
Implemented. New in Oracle Developer Studio 12.6 C++ C++ 11 defines decltype for this. In Sun (–compat=5) mode, C++ omits the typeof keyword, but still supports __typeof and __typeof__.
Conditionals: Omitting the middle operand of a ‘?:’ expression.
Implemented in C only.
__int128: 128-bit integers—__int128.
Not implemented.
Long Long: Double-word integers—long long int.
Implemented in C and C++.
Complex: Data types for complex numbers.
untyped _Complex defaults to double for compatibility with gcc. Implemented in C only.
Floating Types: Additional Floating Types.
Oracle Developer Studio C and C++ implement the 128-bit long double type, but not with the type named __float128.
Half-Precision: Half-Precision Floating Point.
Not implemented.
Decimal Float: Decimal Floating Types.
Not implemented.
Hex Floats: Hexadecimal floating-point constants.
C 99. Implemented in C only.
Fixed-Point: Fixed-Point Types.
Not implemented.
Named Address Spaces: Named address spaces.
Not implemented.
Zero Length: Zero-length arrays (general zero length arrays).
int foo[0];
Implemented in C++ in GNU compatibility mode, or with –features=zla.
Implemented in Oracle Developer Studio 12.6 C compiler with -features=zla.
Zero Length: Zero-length arrays (flexible array members).
int foo[]; // at the end of a struct
Implemented in C++ in GNU compatibility mode, or with –features=zla.
Implemented in C.
Empty Structures: Structures with no members.
Implemented in Oracle Developer Studio 12.6 for C compiler.
Implemented. For C, requires –features=extensions.
Variable Length: Arrays whose length is computed at run time.
C 99. Implemented in C and C++.
Variadic Macros: Macros with a variable number of arguments
C 99. Implemented in C and C++. Oracle Developer Studio implements the gcc extension for supplying a user-defined name for the variable macro arguments. gcc extensions for missing variables arguments are not implemented in C++.
Escaped Newlines: Slightly looser rules for escaped newlines.
Implemented in Oracle Developer Studio 12.6 for C compiler.
Not implemented.
Subscripting: Any array can be subscripted, even if not an lvalue.
C 99. Standard C++. Implemented in C and C++.
Pointer Arith: Arithmetic on void-pointers and function pointers.
Implemented in C only. Warning is generated.
Pointers to Arrays: Pointers to arrays with qualifiers work as expected.
Not implemented.
Initializers: Non-constant initializers.
C 99. Standard C++. Implemented.
Compound Literals: Compound literals give structures, unions, or arrays as values.
C 99. Implemented in C.
Designated Inits: Labeling elements of initializers.
C 99. Implemented in C.
Case Ranges: `case 1 ... 9` and such.
Implemented.
Cast to Union: Casting to the union type from any member of the union.
Not implemented.
Mixed Declarations: Mixing declarations and code.
C 99. Standard C++. Implemented.
Attribute Extensions
__has_attribute() can be used to test for recognized attributes. For more information, see Attributes.
Function Prototypes: Prototype declarations and old-style definitions.
Implemented in C only. Not relevant to C++.
C++ Comments: are recognized.
Implemented in C.
Dollar Signs: Dollar sign is allowed in identifiers.
Implemented. Requires –features=iddollar.
Character Escapes: ‘\e’ stands for the character <ESC>.
Not implemented.
Alignment: Inquiring about the alignment of a type or variable.
C 11, spelled _Alignof. __alignof__ supported in C and C++. C++ supports alignof in C++ 11 mode.
Inline: Defining inline functions (as fast as macros).
C 99 and Standard C++. Implemented. Before GCC implemented the standard, it created a static function body instead of an external one. If your code depends on this, you can use the C option –features=no%extinl to get similar behavior from the Oracle Developer Studio C compiler.
Volatiles: What constitutes an access to a volatile object.
Implemented. Compatible with GCC.
Using Assembly Language with C: Instructions and extensions for interfacing C with assembler.
Implemented. C and C++ implement gcc-compatible asm() statements, including constraints, asm() labels, and explicit register variables.
Alternate Keywords: __const__, __asm__, among others, for header files.
Implemented. Oracle Developer Studio 12.5 C++ added __asm and __volatile keyword spellings.
Incomplete Enums: enum foo;, with a subsequent definition.
C++ 11. Implemented in C and C++. Must be C++ 11 mode.
Function Names: Printable strings which are the name of the current function.
Oracle Developer Studio compilers support __func____FUNCTION__ and __PRETTY_FUNCTION__.
Return Address: Getting the return or frame address of a function.
Not implemented.
Vector Extensions: Using vector instructions through built-in functions.
Offsetof: Special syntax for implementing offsetof.
Implemented in Oracle Developer Studio 12.6 for C and C++ compilers
__sync Builtins: Legacy built-in functions for atomic memory access.
Implemented. Use –xatomic=studio. See Atomics. (gcc deprecates these functions in favor of the standard __atomic builtins.)
__atomic Builtins: Atomic built-in functions with memory model.
Implemented. New in Oracle Developer Studio 12.6. Use –xatomic=studio. See Atomics.
Integer Overflow Builtins: Built-in functions to perform arithmetic and arithmetic overflow checking.
Not implemented.
x86 Specific Memory Model Extensions for Transactional Memory: x86 memory models.
Not implemented.
Object Size Checking: Built-in functions for limited buffer overflow checking.
Not implemented.
Pointer Bounds Checker Built-ins: Built-in functions for Pointer Bounds Checker.
Not implemented.
Cilk Plus Built-ins: Built-in functions for the Cilk Plus language extension.
Not implemented.
Other Builtins: Other built-in functions.
__builtin_constant_p() can test whether something is a compile-time constant. Most other built-ins are not yet implemented by Oracle Developer Studio.
__builtin_unreachable() was added as a no-op to C++. It might be added to C.
__builtin_expect() was added in Oracle Developer Studio 12.6 in C compiler.
Target Builtins: Built-in functions specific to particular targets.
Not implemented.
Target Format Checks: Format checks specific to particular targets.
Not implemented.
Pragmas: Pragmas accepted by gcc.
#pragma once implemented. Others not implemented.
Unnamed Fields: Unnamed struct/union fields within structs/unions.
C++ 11. Implemented in C and C++.
Thread-Local: Per-thread variables.
C 99. C++ 11. Implemented in C and C++.
Binary Constants: Binary constants using the ‘0b’ prefix.
Implemented in C++ only.

SIMD Vector Support

Oracle Developer Studio supports some architecture-specific intrinsics to encode vector operations using CPU-specific instructions. The data types for these are created using the vector_size attribute or by including an appropriate header file as described in Header File Compatibility. Some C operators are supported on such types, but in some cases you might have to use the CPU-specific intrinsics.

For a discussion of types like _m128 and operations on them, see the SPARC64 X section in SIMD Intrinsics in Oracle Developer Studio 12.6: C User’s Guide.

Oracle Developer Studio implements a set of x86 vector intrinsics with names that begin with the prefix _mm_. On Linux they can be accessed using xmmintrin.h which is bundled with gcc. On Oracle Solaris, they can be accessed by including sys/mmintrin.h which is bundled with the Oracle Developer Studio compilers. For more information, see Compiler Support for Intel MMX and Extended x86 Platform Intrinsics in Oracle Developer Studio 12.6: C User’s Guide

C++ Specific Features

The Oracle Developer Studio C++ compiler supports the –features=cplusplus_redef option that enables a non-standard value of the __cplusplus macro for source codes that requires that setting. For more information, see –xrestrict[=f] in Oracle Developer Studio 12.6: C++ User’s Guide.

Some other GNU extensions for C++ are:

  • long long constants in enumerations.

  • Allowing a typedef for void as a function parameter.

    typedef void VOID;
    int foo(VOID);
  • _Bool, which is equivalent to bool on Oracle Linux when <stdbool.h> is included.

  • extern template.

  • long long bit-field.

  • pragma pack push/pop.

For information about C++ Extensions, see Extensions to the C++ Language in the GCC documentation. Information about the same functionality in the Oracle Developer Studio compiler can be found in the following table.

Table 3  GNU C++ Extensions
GNU C++ Extension
Oracle Developer Studio Implementation Status
C++ Volatiles: Determine what constitutes an access to a volatile object.
Compatible Implementation.
Restricted Pointers: C 99 restricted pointers and references.
Implemented.
Vague Linkage: Where G++ puts inlines, vtables and the like.
Oracle Developer Studio also uses COMDAT for these, probably in a slightly different way.
C++ Interface: You can use a single C++ header file for both declarations and definitions.
Not implemented. Deprecated in gcc.
Template Instantiation: Methods for ensuring that exactly one copy of each needed template instantiation is emitted.
Oracle Developer Studio also uses COMDAT for these, probably in a slightly different way.
Bound member functions: You can extract a function pointer to the method denoted by a ‘->*’ or ‘.*’ expression.
Not Implemented.
C++ Attributes: Variable, function, and type attributes for C++ only.
Function Multiversioning: Declaring multiple function versions.
Not Implemented.
Namespace Association: Strong using directives for namespace association.
Not implemented. Deprecated in gcc in favor of a standard C++ 11 feature.
Type Traits: Compiler support for type traits.
Not Implemented.
C++ Concepts: Improved support for generic programming.
Not Implemented.
Java Exceptions: Tweaking exception handling to work with Java.
Not Implemented.
Deprecated Features: Things that are scheduled to be removed from C++.
Not Implemented.
Backwards Compatibility: Compatibilities with earlier definitions of C++.
Not Implemented.

Attributes

The full documentation for attributes implemented in the Oracle Developer Studio 12.6 compilers is in Supported Attributes in Oracle Developer Studio 12.6: C User’s Guide and Supported Attributes in Oracle Developer Studio 12.6: C++ User’s Guide.

The __has_attribute() built-in can be used with both gcc and Oracle Developer Studio compilers to test for recognized attributes.

The following attributes are new in Oracle Developer Studio 12.6 C++: aligned, deprecated, weak(alias), weakref, packed, tls_model, vector_size, and visibility.

The Oracle Developer Studio compilers do not support all of the syntaxes for attributes.

Table 4  GCC Attributes
GCC Attribute Category
Attributes supported in Oracle Developer Studio
Function Attributes: Declaring that functions have no side effects, or that they can never return.
alias, aligned, always_inline, const, constructor / destructor, deprecated (C++ 14), malloc, noinline, nonnull (C++), noreturn, nothrow (c++ only), pure, regparm/ssregparm (C++ only), returns_twice, transparent_union(C++ only), visibility, warn_unused_result (C++), weak (and alias), weakref (C++)
Variable Attributes: Specifying attributes of variables.
aligned, common (C++), deprecated, mode (C++), nocommon (C++), packed , section (C), tls_model, vector_size, weak
Type Attributes: Specifying attributes of types.
aligned, deprecated, packed, visibility
Enumerator Attributes: Specifying attributes on enumerators.
deprecated

Command-Line Options

Both the Oracle Developer Studio and the gcc compilers implement traditional compiler options like –g, –c, –o, and many others. The following table describes the options in the Oracle Developer Studio compilers that have been implemented specifically to be compatible with gcc.

The following options in Oracle Developer Studio are compatible with gcc.

Table 5  Compatible Options
Option
Description
–std
The –std option selects a language standard like C 11, C++ 11, and others.
–pedantic
Issues errors or warnings for technical violations of the standard that would otherwise be accepted. This option is new in the Oracle Developer Studio 12.6 C++ compiler.
–m32 / –m64
Selects 32-bit or 64-bit binary output.
–shared
Produce a shared library. In Oracle Solaris Studio 12.4, the –shared option acted like an alias for –G. In Oracle Developer Studio 12.6, this option acts like the –shared option in gcc. See Table 6.
–gz=[=type]
Produce compressed debug sections in DWARF format, if that is supported. If type is not given, the default type depends on the capabilities of the assembler and linker used. type might be one of none (do not compress debug sections), zlib (use zlib compression in ELF gABI format), or zlib-gnu (use zlib compression in traditional GNU format). If the linker does not support writing compressed debug sections, the option is rejected. Otherwise, if the assembler does not support them, –gz is silently ignored when producing object files.
-fsemantic-interposition
Controls whether exported symbols need to be replaced using dynamic interposition at runtime. For example, if the symbols need to be replaceable, then the symbols must not be inlined by the optimizer.
-fshort-enums
Use smaller types for enums. This also results in automatically packing enums in structs.

The following options work differently between Oracle Developer Studio and GCC.

Table 6  Options with Differences
Oracle Developer Studio Option
GCC Option
Description
–xM
–M
Print make-style dependencies for a source file. In gcc, –xM performs another function. In Oracle Developer Studio, –M selects a linker map file.
–B(static| dynamic)
–Wl,–B(static| dynamic)
GNU Linker supports this behavior, but gcc does not. Use –Wl to pass the option to GNU ld. In gcc, –B performs another function.
–G
–shared
When producing a shared library, –shared in gcc adds C++ library dependencies. The –G option in the Oracle Developer Studio compilers does not add them.

The following gcc-style options are automatically translated into corresponding options in Oracle Developer Studio. This list of options can be seen by passing this option to the following option to the C or C++ compiler: –xhelp=gccflags.

Table 7  Automatically Translated Options
gcc option in Oracle Developer Studio
Behavior in Oracle Developer Studio compilers
–MM
Same as –xM1
–Ofast
Same as –fast
–Wall
Same as +w2 (C++ only)
–Wall
Same as –v (C only)
–Werror
Same as –errwarn=%all
–Wpedantic
Same as –pedantic
–fno-elimininate-unused-debug-types
Accept and ignore
–fopenmp
Same as –xopenmp
–fPIC
Same as –KPIC
–fpic
Same as –Kpic
–fplan9-extensions
Accept and ignore (C only).
–fplugin-arg-name=t
Warn and ignore (C only)
–fplugin=t
Warn and ignore (C only)
–fsigned-char
Same as –xchar=signed (C only)
–fsyntax-only
Same as –xe
–funsigned-char
Same as –xchar=unsigned (C only)
–gdwarf-version
Same as –xdebugformat=dwarf
–gz[=cmp-type]
Same as -xcompress=debug with -xcompress_format=cmp-type.
–gz with no sub-option is equivalent to -gz=zlib.
–gstabs
Same as –xdebugformat=stabs
–gstabs+
Suggest using –xdebugformat=stabs; option ignored
–iplugindir=t
Warn and ignore
–march=a
Same as –xtarget=a
–mcpu=a
Same as –xtarget=a
–mfmaf
Same as –fma=fused
–mno-vis
Same as –xvis=no
–mno-vis2
Same as –xvis=no
–mno-vis3
Same as –xvis=no
–mtune=a
Same as –xtarget=a
–mvis
Same as –xvis
–mvis2
Same as –xvis
–mvis3
Same as –xvis
–no-canonical-prefixes
Accept and ignore
–no-fma
Same as –fma=none
–no-fmaf
Same as –fma=none
–no-trigraphs
Same as –xtrigraphs=no
–nodefaultlibs
Same as –xnolib (C++ only)
–pass-exit-codes
Warn and ignore
–pedantic-errors
Same as –pedantic
–pipe
Warn and ignore
–save-temps
Same as –keeptmp
–shared
Same as –G
–specs=t
Warn and ignore
–traditional
Same as –Xs (C only)
–trigraphs
Same as –xtrigraphs=yes

Architecture and CPU Options

The GCC compiler uses platform specific flags to control the instruction set selection for the generated code. This is done through the –march option on x86 platforms, and -mcpu flag on SPARC platforms. On x86 and SPARC platforms, selecting a value for the instruction set will also choose a corresponding value for the –mtune option which controls how the code is scheduled. For more information, see x86 Options.

The Oracle Developer Studio compilers use the following options to control this behavior:

  • -xtarget – Select instruction set and code scheduling.

  • -xarch – Select the instruction set only.

  • -xchip/-xcache – Control the code scheduling.

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

The GCC compilers on x86 have many –m options to select the specific instruction usage outside the compatible instruction set extensions.

The GCC compilers define CPP macros to identify which –m options are in effect. Oracle Developer Studio does not yet define these macros. The macros are defined to 1, unless stated.

Table 8  Architecture Options
gcc Option
Oracle Developer Studio Option
-mxxx, where xxx is an instruction set extension.
none
-march=xxx (x86)
-mcpu=xxx (SPARC)
Select instructions and code scheduling.
-xtarget
-mtune=xxx
Generate code scheduling to optimize for this specific chip.
-xchip
-xcache

For more information, see the following documentation references:

Table 9  x86 –xarch and –m Options
GCC Option
Oracle Developer Studio Option
GCC Predefines
-mpentium
-xarch=pentium
-mpentiumpro
-xarch=pentium_pro
-msse
-xarch=sse
-msse2
-xarch=sse2
-msse3
-xarch=sse3
__SSE3__
-mssse2
-xarch=ssse3
-msse4.1
-xarch=sse4_1
__SSE4_1__ __SSSE3__
-msse4.2
-xarch=sse4_2
__SSE4_2__ __POPCNT__
-mpopcnt
-xarch=ss4_2
__POPCNT__
-mlzcnt
-xarch=avx2
__LZCNT__
-msse4
-xarch=sse4
-mavx
-xarch=avx
__AVX__
__XSAVE__
__BIGGEST_ALIGNMENT__=32
-mpclmul
-xarch=aes
__PCLMUL__
-maes
-xarch=aes
__AES__
-mrdrnd
-xarch=avx_i
__RDRND__
-msgsbase
-xarch=avx_i
-mf16c
-xarch=avx_i
__F16C__
-mbmi
-xarch=avx2
__BMI__
-mbmi2
-xarch=avx512
__BMI2__
-mavx2
-xarch=avx2
__AVX2__
-mavx512f
-xarch=avx512
__AVX512F__
__FP_FAST_FMA__
__FP_FAST_FMAF__
__BIGGEST_ALIGNMENT__=64
-mprefetchwt1
-xarch=avx512
__PREFETCHWT1__
__PREFCHW__
Table 10  x86 –march and –xtarget Options
GCC -march / -mcpu / -mtune
Oracle Developer Studio -xtarget
GCC Predefines
generic
-xtarget=generic
native
-xtarget=native
(older CPUs omitted)
...
...
sandybridge
-xtarget=sandybridge
___corei7_avx
__corei7_avx__
__sandybridge
__sandybridge__
ivybridge
-xtarget=ivybridge
haswell
-xtarget=haswell
__core_avx2
__core_avx2__
__haswell
__haswell__
Table 11  SPARC –m and –xarch Options
GCC Option
Oracle Developer Studio Option
Predefines
-mvis
-xarch=sparcvis
__VIS__ = __VIS = 0x100
-mvis2
-xarch=sparcvis2
__VIS__ = __VIS = 0x200
-mvis3
-xarch=sparcvis3
__VIS__ = __VIS = 0x300
-mfmaf
-xarch=sparcfmaf
__FP_FAST_FMA=1
__FP_FAST_FMAF=1
Table 12  SPARC –march and –xtarget Options
-mcpu / -mtune
Oracle Developer Studio Option
Predefines
native
-xtarget=native
(older CPUs omitted)
...
...
-mcpu=niagara4
-xtarget=T4
Same as -mvis3 -mfmaf
-mcpu=niagara7
-xtarget=T7