Table of Contents        Previous topic       Next topic       

C/C++ COMPILER->Pragmas->#pragma optimize

#pragma optimize( "[optimization-list]", {on | off} )

Specifies optimizations to be performed on a function-by-function basis. The optimize pragma must appear outside a function and takes effect at the first function defined after the pragma is seen. The on and off arguments turn options specified in the optimization-list on or off.
gperform global register allocation
ruse register keywords
psuppress integral promotion
These are the same letters used with the /O compiler options. For example,

#pragma optimize( "rg", on )

Using the optimize pragma with the empty string (" ") either turns off all optimizations or restores them to their original settings.

#pragma optimize( "", off )

#pragma optimize( "", on )