opt

Date:

02-09-2023

NAME

opt, noopt - Enables or disables automatic optimizations and directives

SYNOPSIS

#pragma _CRI opt
#pragma _CRI noopt

DESCRIPTION

The noopt directive disables all automatic optimizations and causes optimization directives to be ignored in the source code that follows the directive. Disabling optimization removes various sources of potential confusion in debugging. The opt directive restores the state specified on the command line for automatic optimization and directive recognition. These directives have global scope and override related command line options.

EXAMPLES

Example 1: opt directive

#include <stdio.h>

void sub1(void)
{
        printf("In sub1, default optimization\n");
}

#pragma _CRI noopt
void sub2(void)
{
        printf("In sub2, optimization disabled\n");
}
#pragma _CRI opt

void sub3(void)
{
        printf("In sub3, optimization enabled\n");
}

main()
{
        printf("Start main\n");
        sub1();
        sub2();
        sub3();
}

SEE ALSO

intro_directives(1)