ILE C/C++ Compiler Reference


ALIAS

Indicates whether a program contains certain categories of aliasing or whether a program 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.

Read syntax diagramSkip visual syntax diagramALIAS Syntax:
 
|--+---------------------------------+--------------------------|
   |         .------------------.    |
   |         | .-*NOTYPEPTR---. |    |
   |         | +-*NOALLPTRS---+ |    |
   |         | +-*NOADDRTAKEN-+ |    |
   |         V +-*ANSI--------+ |    |
   '-ALIAS(----+-*NOANSI------+-+--)-'
               +-*ADDRTAKEN---+
               +-*ALLPTRS-----+
               '-*TYPEPTR-----'
 

*ANSI|*NOANSI
When *ANSI is in effect, 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.

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.

*ADDRTAKEN|*NOADDRTAKEN
When *ADDRTAKEN is in effect, 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.

When *NOADDRTAKEN is specified, the compiler generates aliasing based on the aliasing rules that are in effect.

*ALLPTRS|*NOALLPTRS
When *ALLPTRS is in effect, pointers are never aliased (this also implies *TYPEPTR). Specifying *ALLPTRS is an assertion to the compiler that no two pointers point to the same storage location. The suboption *ALLPTRS is only valid if *ANSI is also specified.
*TYPEPTR|*NOTYPEPTR
When *TYPEPTR is in effect, pointers to different types are never aliased. Specifying *TYPEPTR is an assertion to the compiler that no two pointers of different types point to the same storage location. The suboption *TYPEPTR is only valid if *ANSI is also specified.

Notes:
  1. If conflicting ALIAS settings are specified, the last setting specified is used. For example, if ALIAS(*TYPEPTR *NOTYPEPTR) is specified, *NOTYPEPTR is used.
  2. ALIAS 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.
  3. The following are not subject to type-based aliasing.

[ Top of Page | Previous Page | Next Page | Contents | Index ]