How C + + release compiles when a piece of code is not optimized

Source: Internet
Author: User

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

Feature only in Professional and Enterprise Edition Code optimization are supported only in Visual C + + Professional and Enterprise Editions. For more information, see Visual C + + Editions.

Specifies optimizations to is 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 are seen . The on and off arguments turn options specified in the Optimization-list on or off.

The optimization-list can is zero or more of the parameters shown in Table 2.2.

Table 2.2 Parameters of the Optimize Pragma

Parameter (s) Type of optimization
A assume no aliasing.
G Enable global Optimizations.
P Improve floating-point consistency.
S or T specify short or fast sequences of machine code.
W assume no aliasing across function calls.
Y Generate Frame pointers on the program stack.


These is the same letters used with the/o compiler options. For example,

#pragma optimize ("ATP", ON)

Using the optimize pragma with the empty string ("") is a special form of the directive. It either turns off all optimizations or restores them to their original (or default) settings.

#pragma optimize ("", off)
.
.
.
#pragma optimize ("", ON)

How C + + release compiles when a piece of code is not optimized

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.