/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
- Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
- Click the C/C++ folder.
- Click the Optimization property page.
- Modify the Optimize for Processor property.
To set this compiler option programmatically
See OptimizeForProcessor Property.