ASSERT(RESTRICT) | ASSERT(NORESTRICT)

Category

Optimization and tuning

Pragma equivalent

None.

Purpose

Enables optimizations for restrict qualified pointers.

Syntax

Read syntax diagramSkip visual syntax diagramASSERT( RESTRICTNORESTRICT )

Defaults

ASSERT(RESTRICT)

Parameters

RESTRICT
Optimizations based on restrict qualified pointers are enabled.
NORESTRICT
Optimizations based on restrict qualified pointers are disabled.

Usage

Restrict qualified pointers were introduced in the C99 Standard and provide exclusive initial access to the object that they point to. This means that two restrict qualified pointers, declared in the same scope, designate distinct objects and thus should not alias each other (in other words, they are disjoint). The compiler can use this aliasing in optimizations that may lead to additional performance gains.

Optimizations based on restrict qualified pointers will occur unless the user explicitly disables them with the option ASSERT(NORESTRICT).

ASSERT(RESTRICT) does not control whether the keyword restrict is a valid qualifier or not. Syntax checking of the restrict qualifier is controlled by the language level or KEYWORD option.

You are responsible for ensuring that if a restrict pointer p references an object A, then within the scope of p, only expressions based on the value of p are used to access A. A violation of this rule is not diagnosed by the compiler and may result in incorrect results. This rule only applies to ASSERT(RESTRICT).

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

Predefined macros

None.

Related information

For more information on related compiler options, see: