None
Indicates whether a program contains certain categories of aliasing or does not conform to C/C++ standard aliasing rules. The compiler limits the scope of some optimizations when there is a possibility that different names are aliases for the same storage location.
.-:---------------. | .-notypeptr---. | | +-restrict----+ | | +-global------+ | | +-noallptrs---+ | | +-ansi--------+ | V +-noaddrtaken-+ | >>- -q--alias--=----+-addrtaken---+-+-------------------------->< +-noansi------+ +-allptrs-----+ +-noglobal----+ +-norestrict--+ '-typeptr-----'
-qalias=noaddrtaken:noallptrs:ansi:global:restrict:notypeptr
-qalias=noaddrtaken:noallptrs:ansi:global:restrict:notypeptr for
all invocation commands except cc. -qalias=noaddrtaken:noallptrs:noansi:global:restrict:notypeptr for
the cc invocation command.When noaddrtaken is specified, the compiler generates aliasing based on the aliasing rules that are in effect.
When noansi is in effect, 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.
-qalias=global produces better performance at higher optimization levels and also better link-time performance. If you use -qalias=global, it is recommended that you compile as much as possible of the application with the same version of the compiler to maximize the effect of the suboption on performance.
-qalias=restrict is independent from other -qalias suboptions. Using the -qalias=restrict option will usually result in performance improvements for code that uses restrict-qualified pointers. Note, however, that using -qalias=restrict requires that restricted pointers be used correctly; if they are not, compile-time and runtime failures may result. You can use norestrict to preserve compatibility with code compiled with versions of the compiler previous to V9.0.
-qalias makes assertions to the compiler about the code that is being compiled. If the assertions about the code are false, then the code generated by the compiler may result in unpredictable behaviour when the application is run.
The following are not subject to type-based aliasing:
None.
xlc myprogram.c -O -qalias=noansi