JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.2: C User's Guide
search filter icon
search icon

Document Information


1.  Introduction to the C Compiler

2.  C-Compiler Implementation-Specific Information

3.  Parallelizing C Code

4.  lint Source Code Checker

5.  Type-Based Alias Analysis

5.1 Introduction to Type-Based Analysis

5.2 Using Pragmas for Finer Control

5.2.1 #pragma alias_level level (list) #pragma alias (type, type [, type]...) #pragma alias (pointer, pointer [, pointer]...) #pragma may_point_to (pointer, variable [, variable]...) #pragma noalias (type, type [, type]...) #pragma noalias (pointer, pointer [, pointer]...) #pragma may_not_point_to (pointer, variable [, variable]...)

5.3 Checking With lint

5.3.1 Struct Pointer Cast of Scalar Pointer

5.3.2 Struct Pointer Cast of Void Pointer

5.3.3 Cast of Struct Field to Structure Pointer

5.3.4 Explicit Aliasing Required

5.4 Examples of Memory Reference Constraints

5.4.1 First Example

5.4.2 Second Example

5.4.3 Third Example

5.4.4 Fourth Example

5.4.5 Fifth Example

5.4.6 Sixth Example

5.4.7 Seventh Example

6.  Transitioning to ISO C

7.  Converting Applications for a 64-Bit Environment

8.  cscope: Interactively Examining a C Program

A.  Compiler Options Grouped by Functionality

B.  C Compiler Options Reference

C.  Implementation-Defined ISO/IEC C99 Behavior

D.  Supported Features of C99

E.  Implementation-Defined ISO/IEC C90 Behavior

F.  ISO C Data Representations

G.  Performance Tuning

H.  The Differences Between K&R Solaris Studio C and Solaris Studio ISO C


5.1 Introduction to Type-Based Analysis

You can use the -xalias_level option to specify one of seven alias levels. Each level specifies a certain set of properties about the way you use pointers in your C program.

As you compile with higher levels of the -xalias_level option, the compiler makes increasingly extensive assumptions about the pointers in your code. You have greater programming freedom when the compiler makes fewer assumptions. However, the optimizations that result from these narrow assumptions may not result in significant runtime performance improvement. If you code in accordance with the compiler assumptions of the more advanced levels of the -xalias_level option, there is a greater chance that the resulting optimizations will enhance runtime performance.

The -xalias_level option specifies which alias level applies to each translation unit. For cases where more detail is beneficial, you can use new pragmas to override whatever alias levels are in effect so that you can explicitly specify the aliasing relationships between individual types or pointer variables in the translation unit. These pragmas are most useful when the pointer usage in a translation unit is covered by one of the available alias levels, but a few specific pointer variables are used in an irregular way that is not allowed by one of the available levels.