Option Type | Default Value | #pragma options | C | C++ |
-qoption | ansi:typeptr:noallptrs:noaddrtaken* | ALIAS=suboption[:suboption] | x | x |
Syntax
-qalias=suboption[:suboption][...] ALIAS=suboption[:suboption]
Purpose
Requests the compiler to apply aliasing assertions to your compilation unit. The compiler
will take advantage of the aliasing assertions to improve optimizations where possible,
unless you specify otherwise.
Notes
If used, #pragma ALIAS=suboption must appear before the first
program statement.
The compiler will apply aliasing assertions according to the following suboptions:
[NO]TYPeptr | Pointers to different types are never aliased. In other words, in the compilation unit no two pointers of different types will point to the same storage location. |
[NO]ALLPtrs | Pointers are never aliased (this also implies -qalias=typeptr). Therefore, in the compilation unit, no two pointers will point to the same storage location. |
[NO]ADDRtaken | Variables are disjoint from pointers unless their address is taken. Any class of variable for which an address has not been recorded in the compilation unit will be considered disjoint from indirect access through pointers. |
[NO]ANSI | Type-based aliasing is used during optimization, which restricts the lvalues that can
be safely used to access a data object. The optimizer assumes that pointers can only
point to an object of the same type. This (ansi) is the default for the xlc
and c89 compilers. This option has no effect unless you also
specify the -O option. If you select noansi, the optimizer makes worst case aliasing assumptions. It assumes that a pointer of a given type can point to an external object or any object whose address is already taken, regardless of type. This is the default for the xlC and cc compiler. |
The following are not subject to type-based aliasing:
Example
To specify worst-case aliasing assumptions when compiling myprogram.c, enter:
xlC myprogram.c -O -qalias=noansi
List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Options that Specify Compiler Characteristics
Equivalent Batch Compile-Link and Incremental
Build Options