Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

/G (Optimize for Processor) Options

/G{3|4|5|6|7|B}

These options tell the compiler to optimize code generation for the specified processor.

/G5 optimizes code for the Intel Pentium processor. It sets the value of the _M_IX86 preprocessor macro to 500.

/G6 optimizes code for the Intel Pentium Pro, Pentium II, Pentium III, and Pentium 4 processors. It sets the value of the _M_IX86 preprocessor macro to 600.

/G7 optimizes code for the Intel Pentium 4 or AMD Athlon. It sets the value of the _M_IX86 preprocessor macro to 700. Code compiled with /G7 may result in these applications running slightly slower on older processors in the Pentium family (for example, Pentium III).

/GB, which is the default option, is equivalent to /G6 for Visual C++ .NET; it sets the value of _M_IX86 to 600.

/G3 and /G4 optimized for 80386 and 80486 processors. The compiler accepts these options for compatibility reasons, but they have no effect.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the Optimization property page.
  4. Modify the Optimize for Processor property.

To set this compiler option programmatically

See OptimizeForProcessor Property.

See Also

Compiler Options | Setting Compiler Options

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.